03-08-2012, 03:52 PM
[eluser]Unknown[/eluser]
Hello everybody.
I'm writing an application using the latest CI version.
My goal is to serve some dynamic routes after everything else.
I tried to make regexp routes and it worked, but i had to write all the present controllers before the regexp, like this:
That works correct, but it needs to populate it every time I add new controller.
Is there any way to accomplish it more dynamic, something more efficient?
I found this http://ellislab.com/forums/viewthread/135105/#666746
There is described a way to change the behavior of the controller lookup methods, but i can't fit my dynamic issue with it.
Any help?
Thanks in advance.
Hello everybody.
I'm writing an application using the latest CI version.
My goal is to serve some dynamic routes after everything else.
I tried to make regexp routes and it worked, but i had to write all the present controllers before the regexp, like this:
Code:
$route['default_controller'] = "organizations";
$route['mobile'] = "mobile/welcome";
$route['mobile/(:any)'] = "mobile/$1";
$route['404_override'] = '';
$route['projects'] = "projects";
$route['projects/(:any)'] = "projects/$1";
$route['news'] = "news";
$route['news/(:any)'] = "news/$1";
$route['([a-zA-z_]+)'] = "articles/cat/$1";
$route['([a-zA-z_]+)/(:any)'] = "articles/catAndArticleName/$1/$2";
Is there any way to accomplish it more dynamic, something more efficient?
I found this http://ellislab.com/forums/viewthread/135105/#666746
There is described a way to change the behavior of the controller lookup methods, but i can't fit my dynamic issue with it.
Any help?
Thanks in advance.