i have a problem with my codeigniter app.
Everytime i want to use show_error() i got the following error message:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Exceptions::$load
Filename: errors/error_general.php
Line Number: 2
Fatal error: Call to a member function helper() on a non-object in …/application/errors/error_general.php on line 2
I dont really know how to fix this
any ideas?
The error message tells the tale…
You must have some custom code in the error file trying to load a helper. The default error template only uses a couple of variables and doesn’t reference the CI_Controller instance (which may not be instantiated yet).
Somewhere in the file you are using
$this->load->helper(), but$thisis a reference toCI_Exceptionsin that scope.How to fix it:
Use a static error template, or use something other than
show_error()if possible. Perhaps write your own function for use after you know Codeigniter is loaded and you have access to classes and helpers.