• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Call to undefined (helper) function

#1
Question 
Hello,

I have a helper function which is loaded in BaseController.php in the normal way with protected $helpers = ['myhelper,].

It is used to add some text details to a view and has been faithfully working without a problem until recently…

Now, when I have any exception thrown, for example:  CodeIgniter\Images\Exceptions\ImageException: The supplied file is not a supported image type (though, any exception/error condition appears to cause the same effect), I receive the following (code terminating) response on any subsequent interaction with the server:  Error: Call to undefined function myhelperFunction() (which is the previously well-behaved helper function inside the view page).

This error remains until I force a cache-refreshing re-load of the page.

I would try to invoke the call with a fully qualified path or namespace, but because it is a helper function, it isn’t namespaced and I’m not sure how to call it using a path, and then the .php file’s internal function name?

It appears as though the framework loses the current BaseController’s setting/environmentsettings?!?

Is this normal?  Why is it happening?  What am I doing wrong?

Thanks.
Reply


Messages In This Thread
Call to undefined (helper) function - by Gary - 04-15-2020, 11:57 AM
RE: Call to undefined (helper) function - by Gary - 04-15-2020, 12:25 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.