CakePhp 2.x路由不起作用

时间:2013-12-02 20:01:01

标签: php arrays cakephp routing router

我有这个链接:localhost / issoisso / categories / getCategories / categoryId:486

但我需要这个:localhost / issoisso / categoria / 486

代码在这里:

gist.github.com/kleberksms/7756990

1 个答案:

答案 0 :(得分:0)

试试这种方式......

    Router::connect('/categoria/:categoryId', array('controller' => 'categories', 'action' => 'getCategories'), array(
    'pass' => array('categoryId'),
    'categoryId' => '[0-9]+'
));