【发布时间】:2013-05-10 14:02:51
【问题描述】:
最后我无法获得带有可选参数的路由来解析 ID。这是我的路线:
Route::set('default', '<action>(/<id>)', array(
'action' => '.*',
'id' => '\d+'
))->defaults(array(
'controller' => 'MediaLibrary',
'action' => 'index'
));
当我查看参数时,我得到:
array(2) (
"action" => string(7) "test/91"
"controller" => string(12) "MediaLibrary"
)
但是,如果我将路线更改为<action>/(<id>),它会起作用。 id 将毫无问题地被解析并且操作将更改为test 而不是test/91
【问题讨论】:
标签: php routing routes kohana kohana-3