CodeIgniter Forums
Routing all requests to single controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Routing all requests to single controller (/showthread.php?tid=20087)



Routing all requests to single controller - El Forum - 06-27-2009

[eluser]Unknown[/eluser]
I need to be able to route all page requests to a single controller function, and pass that function the entire url string so that it can parse it and just fill a premade page with content pulled from a database.

I have attempted setting a custom route like this...

Code:
$route['(:any)'] = "page/parse/$1";

However this only gives me the first section. Is there a way to get all sections of the url passed to the controller function?

EDIT:
I have came to a solution using uri_string() to get the segments within my parse method. I am using this route
Code:
$route[':any'] = "page/parse";
now.

Comments?

Thanks,
Craig


Routing all requests to single controller - El Forum - 07-15-2009

[eluser]OliverHR[/eluser]
Use Modular Extensions - HMVC.

http://codeigniter.com/wiki/Modular_Extensions_-_HMVC/