开发者

Routes and regex in Kohana 3.0

New to Kohana... I was wondering if it's possible to use r开发者_运维知识库egex for setting up a route that handles all requests except for one, 'main_page' for example?

Thanks for your time


you dont need a regex to do that. its like you would do it in the .htaccess

Route::set('main_page', 'main_page(/<action>(/<id>))')
    ->defaults(array(
        'controller'    => 'main_page',
        'action'        => 'some_action',
    ));

Route::set('default', '(<controller>(/<action>(/<id>)))')
    ->defaults(array(
        'controller' => 'welcome',

    ));
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜