CodeIgniter Forums
How do I create pages - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: How do I create pages (/showthread.php?tid=27754)



How do I create pages - El Forum - 02-19-2010

[eluser]JasonS[/eluser]
Sorry for the rather dumb title, my mental facilities are somewhat depleted on a Friday afternoon.

Currently this happens. (I think)

page is routed -> router looks for controller -> if controller doesn't exist throw 404.

I want this to be modified to the following.

page is routed -> router looks for controller -> if controller doesn't exist load the page controller

I assume this has been done many times before. Is anyone willing to share what they have or could someone tell me which system library / function would need to be extended.

Thanks,

Jason


How do I create pages - El Forum - 02-19-2010

[eluser]theprodigy[/eluser]
The library that needs to get extended is the system/libraries/Router.php file, and I believe the function would be _validate_request($segments) (starts on line 198, but I think the lines that would need to be modified are 218 & 239 (and yes, I am advising you would do this through extending the library, not modifying the code in the core library Wink )


How do I create pages - El Forum - 02-20-2010

[eluser]JasonS[/eluser]
Thanks a lot, I will look into this later today.