I have database menu that works in site/index.php and I want to have it as main menu so I transfered code to layouts/main.php but now yii get error: Invalid argument supplied for foreach() even when I access site/index page
class MyWidget extends CWidget
{
public function init()
{
// this method is called by CController::beginWidget()
}
public function run()
{
// this method is called by CController::endWidget()
}
}
and I have 2 call my model and output foreach. I am stuck on this for houers, could You help me please on this simple example?