Call to undefined function base_url() in the error_404 page |
04-02-2015, 06:00 AM
(This post was last modified: 04-02-2015, 01:05 PM by jhonatan4878. Edit Reason: Mor information about the error )
I'm starting with the version 3.0.0 of Codeigniter. One of the new features the manual defines that the error pages now is in the folder "view". My intention was: customising the 404 error to use both localhost and the site. However, when I try to call the funciton base_url() in my error_404.php, I receive this message: "Call to undefined function base_url()";
How can I call the funcions of the helper Url in the error pages by default? Do I need to create a Controller to do it? When I call the function show_404(); it works. For instance: http://www.jhonatanoliveira.com.br/a (if I inform the letter 'a', the Controller calls the show_404() function. Obs: I've modified the routes.php to allow it). But in an incorrect url, an error appears: For instance: http://www.jhonatanoliveira.com.br/css/s...rap.min.cs
I am also having the same issue.
(04-02-2015, 12:54 PM)jhonatan4878 Wrote:(04-02-2015, 12:31 PM)gadelat Wrote: add url helper to autoloader Manually load the url_helper.php inside the error_404.php file: PHP Code: require_once BASEPATH . '/helpers/url_helper.php'; |
Welcome Guest, Not a member yet? Register Sign In |