YII - extension property must be set

I am new to YII. I created simple modules via gii and it works great for me.

However, now when I create a new module manually (copied view / model and controller files of the existing module), and when I make changes to one action function in the controller file, it gives me an error:

TEXT ERROR: The extension property must be set.

What i do

In Newscontroller.php (which I am using as a link)

public function actionAdmin()
{
            Yii::app()->user->setState(Yii::app()->params['newsajaxImageVar'], null);
            $model = new News('search'); 
}

      

HomeController.php (which I am creating)

public function actionAdmin()
{
            Yii::app()->user->setState(Yii::app()->params['homesajaxImageVar'], null);
            $model = new Home('search');   // On this line, it is giving me error for Extension property must be set.
}

      

Has anyone faced the same question before? thank

+3


source to share


1 answer


The problem was caused by:

There are some parameters that I defined in the Home view file and it was not there in main.php and this is the reason when you create $ model = new home ('search') it gives an extension error.



So I added it and now it works great for me.

Thank.

+3


source







All Articles