views:

83

answers:

1

Hi!

New to Kohana... I was wondering if it's possible to use regex for setting up a route that handles all requests except for one, 'main_page' for example?

Thanks for your time

+5  A: 

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',

    ));
antpaw
You can't have a slash at the beginning of a route. Otherwise, this is a perfect example.
shadowhand
wohps.... fixed
antpaw