Open lonnieezell opened 11 years ago
Was looking into this this morning and ran into an initial problem. From within the show_404 method of the MY_Exceptions class, I can't access the CI superobject. When I tried to do get_instance() to get to Smarty it crashes complaining about no Controller as it's going through the routing.
Sounds like the only solution might hacking CI which I don't want to do. Also might be able to try another error handler that operates prior to theirs, but will have to delve into that a bit later.
Yes it seems bizarre to me that it is this difficult. I thought there'd be some way to specify an error controller or something like that...
On 2 August 2013 11:03, Lonnie Ezell notifications@github.com wrote:
Was looking into this this morning and ran into an initial problem. From within the show_404 method of the MY_Exceptions class, I can't access the CI superobject. When I tried to do get_instance() to get to Smarty it crashes complaining about no Controller as it's going through the routing.
Sounds like the only solution might hacking CI which I don't want to do. Also might be able to try another error handler that operates prior to theirs, but will have to delve into that a bit later.
— Reply to this email directly or view it on GitHubhttps://github.com/electricfunction/hero/issues/3#issuecomment-22011552 .
Only resolution I found for this was to set the route['404_override'] to a custom module (error/view). Then have that go to error.thtml. I added an error.thtml file to each of the built in templates.
This can be implemented pretty easily. We use
show_error()
to throw serious error messages. If we extend CodeIgniter's displaying of the error with this function, we can have it (a) check if there is an error.thtml template within the user's current them and, if so, (b) display the error with that template.