Welcome Guest, Not a member yet? Register   Sign In
Custom error pages
#1
Star 

Hello everyone,
I have created MY_Exceptions class which extends CI_Exceptions to be able to overwrite the error methods natively called by CodeIgniter. However, when manually calling these methods I want to be able to send a custom message to the error pages, for example using show_404('Custom message'). But I found that calling show_404() directly is actually calling a method from Common.php which then calls the exception class, i don't want to modify Common.php to change the parameters since that would mean changing the system folder contents.

I was wondering if someone could guide me on best practices to follow when customizing the error pages. For example, should i create an errors controller and redirect users there? Should i edit Common.php in order to fully change the show_404 function?

I hope there is an option using the native error handlers Smile

Thanks for taking the time to read.

BTW, I started using CodeIgniter a few weeks ago and I'm loving it.
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



Theme © iAndrew 2016 - Forum software by © MyBB