开发者

How to change articles/view/slug to articles/slug in CakePHP with Routing

开发者 https://www.devze.com 2023-03-20 10:36 出处:网络
I would like to have a route setup on my CakePHP app that will accomplish the following: I have my app setup to use Slugs that usually generate addresses as

I would like to have a route setup on my CakePHP app that will accomplish the following:

  • I have my app setup to use Slugs that usually generate addresses as

http://www.domain.com/articles/view/my-favorite-cakephp-application

  • However, I would like the address to display as

http://www.domain.com/articles/my-favorite-cakephp-application

How can I accomplish开发者_如何学C that using routes.

Thank you!


in routes.php

Router::connect( '/articles/*', array('controller' => 'articles', 'action' => 'view') );

0

精彩评论

暂无评论...
验证码 换一张
取 消