【发布时间】:2012-02-24 17:53:45
【问题描述】:
我在 Kohana 3 路由中定义了一个规则,但 ID 参数没有传递给该方法。
我在 bootstrap.php 文件中有这个:
Route::set('default', '(<controller>(/<action>(/<id>)))')
->defaults(array(
'controller' => 'home',
'action' => 'index',
));
和控制器
public function action_home($id=NULL)
{
echo $id;
}
但在以下链接示例中,ID 通常为 NULL:
ID 应该是123,但不是。我不知道为什么。
【问题讨论】:
标签: php routing kohana-3 bootstrapping