CodeIgniter Forums
base_url() in error_pages - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: base_url() in error_pages (/showthread.php?tid=17157)



base_url() in error_pages - El Forum - 03-27-2009

[eluser]Skuja[/eluser]
Hi, i am trying to customize error pages a bit... but i can't find a way to call base_url() function, which is necessary for path of images. Has anybody found a CI hack to acomplish this?


base_url() in error_pages - El Forum - 03-27-2009

[eluser]TheFuzzy0ne[/eluser]
I'm sure it's possible, but it should be avoided. Your error pages should be viewable without any of the core libraries/helpers being loaded.

Why not write your own helper that you can just include/require? The helper file can load the configuration itself.


base_url() in error_pages - El Forum - 03-27-2009

[eluser]Skuja[/eluser]
[quote author="TheFuzzy0ne" date="1238175777"]
Why not write your own helper that you can just include/require? The helper file can load the configuration itself.[/quote]

Didn't get this. Whats the purpose of writing my own helpers, if i am not allowed to load them in error pages.

All i want to do is to access my base url variable without redefining it in multiple places.


base_url() in error_pages - El Forum - 03-27-2009

[eluser]TheFuzzy0ne[/eluser]
You can do whatever you want from within your error page using includes and requires. Just avoid the assumption that the CI Super Object is fully instantiated.