CakePHP - 参数无效的路由

时间:2014-03-27 17:11:57

标签: cakephp routing

我试图连接它:

http://example.com/activate/A1B2C3

对此:

http://example.com/users/activate/A1B2C3

Router::connect('/activate/:token', array('controller' => 'users', 'action' => 'activate'), array('pass' => 'token'));

但该参数未被传递。我在这里做错了什么?

1 个答案:

答案 0 :(得分:7)

pass必须是数组。

Router::connect('/activate/:token', 
    array('controller' => 'users', 'action' => 'activate'),
    array('pass' => array('token'))
);