override page_router

Is it possible to replace the default page_router or default_controller with one that checks a custom controller for matching methods if there no matching Controller class found.

e.g.
set page_router to SiteController

/page1 -> No controller found, but found SiteController::page1 method
/mysection -> Found Mysection controller class
/page2/term/2 -> Found SiteController::page2($searchTerm, $pageNum) method

The only way i could achieve this was by manually adding routes like this :
$route['page2/(:any)/(:any)'] = "site/page2/$1/$2";

I'd like it to be more wildcard.

thanks

Comments

  • edited 7:57AM
    I suppose you could Extend the Page_router controller and add your own logic to it and set that as the default in your routes config file.
Sign In or Register to comment.