在Kohana 3.2中如何建立一条接受多个目录的路线,即
http://example.com/foo/bar/controller/action/id
它也应该接受:
http://example.com/foo/controller/action/id
http://example.com/foo/bar/baz/controller/action/id
由于
答案 0 :(得分:0)
Route::set('foo', 'foo(/<controller>(/<action>(/<id>)))')
->defaults(array(
'directory' => 'foo',
'controller' => 'index',
));
Route::set('foobar', 'foo/bar(/<controller>(/<action>(/<id>)))')
->defaults(array(
'directory' => 'foo/bar',
'controller' => 'index',
));
......或......
Route::set('directory', '<directory>(/<controller>(/<action>(/<id>)))',
array(
'directory' => '.*',
))
->defaults(array(
'controller' => 'index',
));