CodeIgniter Forums
Loading a custom helper - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: Loading a custom helper (/showthread.php?tid=76214)



Loading a custom helper - MoeAmine - 04-22-2020

Hello,

I am new to CodeIgniter 4.

How to load a helper?

I read here: https://codeigniter.com/user_guide/general/helpers.html

it says use the following:

PHP Code:
helper('name'); 

What I did, is that I have a file in app/Helpers/name.php with the function name set to name() and I am using the function in a controller that is extending to controller then it is not working.

It says:
Quote:Call to undefined function



RE: Loading a custom helper - jreklund - 04-22-2020

You need to name it name_helper.php.


RE: Loading a custom helper - MoeAmine - 04-22-2020

(04-22-2020, 11:05 AM)jreklund Wrote: You need to name it name_helper.php.

Perfect! Now I get it. It worked. Thanks!