Hi
I’m new to Yii but not to PHP. I’m using the latest version of Yii. Its awesome!
I’m building an App that heavily uses themes. What is the best way to set a load of variables for an entire controller (including which theme we are going to use).
I noticed filters but wasnt sure how these worked. I tried creating a filter like this
public function filterSetGlobalVars($filterChain)
{
Yii::app()->setTheme('admin');
$this->somethingelse = 'more';
$filterChain->run();
}
How does this filter get called without me doing it in each method of the controller. Perhaps I’m doing this all wrong and filters are not the right choice.
Any help greatly appreciated.