CodeIgniter Forums
Error Pages (404, general, DB etc) - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Error Pages (404, general, DB etc) (/thread-55253.html)

Error Pages (404, general, DB etc) - El Forum - 10-17-2012

I don't know if I'm alone in this, but I'm finding the error pages a bit painful.

I'm using a templating system to render certain layouts, and have a "general" layout that I would like to apply to all 4 error pages as supplied by CI (404, DB, General, PHP).

I know I can override the 404 in routes, and I know I could manually drop in HTML to the pages provided - but I don't want to.

I want to have an Error controller, where by I can attach my template syntax to each of the 4 pages/views.

Can anyone shed some light on how to approach this? I found the Exceptions class, but there's not a lot in there that's making much sense to me.

Error Pages (404, general, DB etc) - El Forum - 10-17-2012

I never did such things, but I have seen that PyroCMS has a custom 404-handling. You can have a look at how it is handled in PyroCMS here.

You would just have to extend it to meet your requirements.
Maybe it's even possible to put something like


in errors/error_db.php. Haven't tried it yet though ;P