Welcome Guest, Not a member yet? Register   Sign In
Loading a custom helper
#1

(This post was last modified: 04-22-2020, 10:42 AM by MoeAmine.)

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
Reply
#2

You need to name it name_helper.php.
Reply
#3

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

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




Theme © iAndrew 2016 - Forum software by © MyBB