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',
    ));
 
         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论