Which folder to add custom helper functions to in Yii
yii2
Solution
You can put it in the components folder. Afterwards use the namespace to access it. For example
use app\components\Helper;
and in your code
Helper::something();
Make the helper functions static functions.
Problem
I am trying to create a helper function in Yii 2. To which folder is the PHP file to be added to create a custom helper function in Yii 2 and how do I use it in controllers?