Welcome Guest, Not a member yet? Register   Sign In
another dynamic routes topic
#1

[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:
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";
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.


Messages In This Thread
another dynamic routes topic - by El Forum - 03-08-2012, 03:52 PM
another dynamic routes topic - by El Forum - 03-08-2012, 04:16 PM
another dynamic routes topic - by El Forum - 03-08-2012, 04:23 PM
another dynamic routes topic - by El Forum - 03-08-2012, 04:40 PM
another dynamic routes topic - by El Forum - 07-06-2012, 08:14 AM
another dynamic routes topic - by El Forum - 07-06-2012, 09:14 AM
another dynamic routes topic - by El Forum - 07-06-2012, 10:02 AM
another dynamic routes topic - by El Forum - 07-06-2012, 10:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB