• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom error pages

#2
Hi,

how I handle this:
I use my base controller, which checks if a method exists through a "_remap" method, and if it does not exist, it tries to look for that controllers _404 method, which can then load any view how it wants. Like this:
https://github.com/slax0rr/BaseControlle...r.php#L188
And the documentation on "_remap":
http://www.codeigniter.com/user_guide/ge...thod-calls

You could probably do the same thing, or something similar. So, create a base controller, use "_remap" to check if methods exist, call them if they do, or load custom views if they don't.

Or, you could make a helper in your application, and a function "custom_404" i.e.
Reply


Messages In This Thread
Custom error pages - by gastongr - 10-08-2015, 10:08 PM
RE: Custom error pages - by slax0r - 10-08-2015, 11:24 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.