Welcome Guest, Not a member yet? Register   Sign In
my controller fails to find helper function
#3

(Yesterday, 07:25 AM)grimpirate Wrote: Your  helper is called myvalidate_helper, but the function you define inside it (I'm assuming) is named is_valid_level. There is no myvalidate function. There was no need to change your ci3 code. If you want to be sure the helper is being loaded do the following:
PHP Code:
helper('myvalidate');
if (!
is_valid_level($level3)) { ... 
However, as you stated if you did this then you don't need to use the helper function to load the helper as the Controller will auto load it for you.


Thx for reply. I have reverted to the original code which tries to run a function called is_valid_level in the helper myvalidate.
The error is very similar:   Call to undefined function App\Controllers\is_valid_level()
I then tried calling the helper just before the statement and it made no difference.
So, I have checked the BaseController array is correct, and my Controller extends BaseController, so it doesn't appear to be working?
Any other things to check please?
TIA Paul
Reply


Messages In This Thread
RE: my controller fails to find helper function - by PaulC - Yesterday, 09:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB