if i had a class called appHelper and had "use app\helpers\PoohHelper;" and within my…
- User
if i had a class called appHelper and had "use app\helpers\PoohHelper;" and within my app.. i called the appHelper... how would I use appHelper Poohhelper function?
- Assistant
To use a function from the
PoohHelperclass within yourAppHelperclass, you first need to ensure thatPoohHelperis properly included and utilized withinAppHelper. Here's a step-by-step guide on how to do this:Assuming you have a namespace
app\helpersand your class is declared in this namespace, and you want to access a function from within your class: - User
they are static funnctions
- Assistant
If the functions in the
PoohHelperclass are static, you can directly call them within any method of your class without needing to instantiate . Here's how you can do it step by step: - User
i dont think you understand my question..
so appHelper has its own static functions.. but I also want to use other helper files that I was hoping to call into appHelper, so i wouldnt need to call each helper file on its own.. so appHelper is the main file.. then within it I use "use app\helpers\PODhelper;" and "use app\helpers\ValHelper;" and i want to be able to call appHelper in my controller or model.. and use not only the appHelper static functions, but also same from PODhelper, or Valhelper.
- Assistant