CodeIgniter Forums
Extending CI_Router - Not sure where to start. - 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: Extending CI_Router - Not sure where to start. (/showthread.php?tid=28521)



Extending CI_Router - Not sure where to start. - El Forum - 03-13-2010

[eluser]Kindari[/eluser]
I would like to access http://mysite.com/some-article-name. I can accomplish this either by doing a $route for some-article-name (but then its not dynamic) or by doing $route['(:any)']. The problem with this is that it swallows up all other requests unless I define the route for each controller / method beforehand.

So what I'm hoping to be able to do is extend CI_Router, and after all routes / controllers are checked, before doing show_404, call my function to check if the uri matches an article in a database.

Any suggestions? much appreciated.