Need help with changing the regulars for routing.
Route::set('default', '(<controller>(/<action>(/<id>)))', array( 'id' => '[\d]+', )) ->defaults(array( 'controller' => 'home', 'action' => 'index', 'id' => NULL, )); This route corresponds to URLs like / , /product/ , /product/add/ , /product/add/123 . (<controller>(/<action>(/<id>))) is an expression, followed by an array of expressions to check for the compliance of the parameters, the default values of the parameters are passed to the defaults.
How to change the route:
Route::set('pages', '(<lang>/<slug>(/<subrequest>))', array( 'lang' => '[az]{2}', 'slug' => '[\w\-]+', 'subrequest' => '[\w\-\/]+', )) ->defaults(array( 'controller' => 'Page', 'action' => 'index', 'lang' => 'en', 'slug' => 'home', 'subrequest' => NULL, )); So that:
langcould be set or omittedslugcould be set or omittedsubrequestcould be set (ifslugset) or omitted
those. links to this route would fit: / , /en/ , /en/contacts/ , /contacts/ , /en/contacts/config/meta/ and /contacts/config/meta/