Welcome Guest, Not a member yet? Register   Sign In
Code igniter functions not available in error page
#1

[eluser]Unknown[/eluser]
I have defined my own 404 error page, overwriting the one that comes with Codeigniter, and placed it in system/application/error and named it error_404.php.

This error page has a logo inserted into it using the img tag and I am specifying the path to this image using the base_url() codeigniter function as part of the path.

I have 1 controller for my site and if I show the 404 page by calling it from within the controller via the show_404() function everything works fine. If, however, a URL is typed in that doesn't contain the controller name codeigniter, correctly, shows the error_404.php page but throws up a php error stating that base_url() in an undefined function.

So, why is it that the error page is unaware of codeigniter functions?
#2

[eluser]Colin Williams[/eluser]
Because certain resources haven't been loaded at that point.
#3

[eluser]Unknown[/eluser]
[quote author="Colin Williams" date="1260409965"]Because certain resources haven't been loaded at that point.[/quote]

Is there a solution or am I unable to use any functions in the error page? I can just hard code the url's for the images but if there is a solution I'd rather use that.




Theme © iAndrew 2016 - Forum software by © MyBB