CodeIgniter Forums
errors views and helpers - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: errors views and helpers (/showthread.php?tid=68768)



errors views and helpers - LEBOSSS - 08-23-2017

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?


RE: errors views and helpers - curiousteam - 08-23-2017

you need to load url helper from config/autoload.php to use this helper function.
set as below:
$autoload['helper'] = array('url');


RE: errors views and helpers - LEBOSSS - 08-23-2017

(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.


RE: errors views and helpers - LEBOSSS - 08-23-2017

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


RE: errors views and helpers - stebo - 08-24-2017

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