Routes 路由子目录

Routes 路由子目录,routes,kohana-3,Routes,Kohana 3,在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 谢谢Route::set('foo','foo(/(/(/))')) ->默认值(数组)( '目录'=>'foo', “控制器”=>“索

在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
谢谢

Route::set('foo','foo(/(/(/))'))
->默认值(数组)(
'目录'=>'foo',
“控制器”=>“索引”,
));
路由::set('foobar','foo/bar(/(/(/))'))
->默认值(数组)(
'目录'=>'foo/bar',
“控制器”=>“索引”,
));
。。。或者

Route::set('directory', '<directory>(/<controller>(/<action>(/<id>)))',
    array(
        'directory' => '.*',
    ))
    ->defaults(array(
        'controller' => 'index',
    ));
Route::set('directory','(/(/(/))),
排列(
'目录'=>'.*',
))
->默认值(数组)(
“控制器”=>“索引”,
));
Route::set('directory', '<directory>(/<controller>(/<action>(/<id>)))',
    array(
        'directory' => '.*',
    ))
    ->defaults(array(
        'controller' => 'index',
    ));