Question

I have a class with some static helper methods. I want to use these methods from the layout file. These methods contain some common code used by all layout files. Even putting the class in 'components' folder does not solve the problem.

Was it helpful?

Solution

You have to import the class before you can use it:

Yii::import('ext.components.YourClassName');
$class = new YourClassName;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top