Welcome Guest, Not a member yet? Register   Sign In
Loading a helper on error_404.php
#1

[eluser]William Rufino[/eluser]
Is it possible to load a hepler into the 404 error page?
I tried this way <?php $CI =& get_instance();
$CI->load->helper('url');?>

but it doesn't work :/
#2

[eluser]tonanbarbarian[/eluser]
the issue is that in a lot of cases (most actually) the controller is not loaded when the 404 error is processed
this is because CI processes the route to determine the controller to load. if the router is unable to determine a controller it goes to 404

however this is nothing stopping you from loading the helper in other ways
you can determine the path to the helper yourself and include it
looking in the system/libraries/Loader.php for the helper method will give you some ideas as to the paths you need to check and or include to load a helper
#3

[eluser]William Rufino[/eluser]
Oh ok! I did it that way, but i thought could be a CI way to do it hhe! thx




Theme © iAndrew 2016 - Forum software by © MyBB