CodeIgniter Forums

Full Version: errors views and helpers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello family,
I wonder why the helpers functions do not work in error views. For example, why is it impossible to do
PHP Code:
echo site_url('css/styles'); 
in the file: application/views/errors/html/error_404.php?
you need to load url helper from config/autoload.php to use this helper function.
set as below:
$autoload['helper'] = array('url');
(08-23-2017, 11:14 AM)curiousteam Wrote: [ -> ]you need to load url helper from config/autoload.php to use this helper function.
set as below:
$autoload['helper'] = array('url');

I know how these helpers work. But my problem is that, in codeigniter errors views, it's not possible to use helpers functions. Why?
Try it yourself, you 'll see that you can't use neither codeigniter native helpers functions, nor your own functions in errors views.
I know how it works. That is not my question. My question is why it is impossible to use the functions of the native helpers or helpers i created in the error views. Try to use site_url() function in the error_404 errors view and you'll see that it is not possible to use it. Try it yourself
Hey,

I've checked this issue and am facing the same problem.

Example:
With the use of site_url() or base_url() I am not able to use my global CSS with the advantage of dynamic paths.

Greets,
stebo