开发者

Can anyone help me on a kohana 3.1 route question?

I'm trying to make a static route. I 开发者_Go百科have a few controllers inside classes/controllers/admin/ but this one I want it to be on a separate module. The class is called Controller_filas and it rests on the module/filas/classes/controller dir.

I want that the url admin/filas route to /filas. Also I'll make a simple redirect if the user type /filas directly it redirect do admin/filas

Route::set('filas', 'admin/<controller>(/<action>)',
        array('controller'=> 'filas'))
        ->defaults(array('action'     => 'index'));

What's wrong with this? Thank you


Make sure your other routes don't match admin/filas URL. Remember that routes are matched in the order they are added in bootstrap, so if one of the previous routes matched your URL, other routes will not be executed.
Your rule should work just fine. Make a simple test - comment all other routes leaving just this one and check if the route works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜