开发者

Can anyone help me on a kohana 3.1 route question?

开发者 https://www.devze.com 2023-04-03 19:28 出处:网络
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

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

精彩评论

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

关注公众号