CodeWithCoffee
CodeWithCoffee

Reputation: 1904

YII - Extension property must be set error

I am new to YII. I have creates simple modules through gii and it is working fine for me.

However, now when I am creating new module manually (Copied view / model and controller files of existing module ) and when i am making change in one action function in controller file, it giving me error that :

ERROR TEXT : Extension property must be set.

What I am doing is

In Newscontroller.php (Which I am using as reference )

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.
}

Did anyone face same issue before ? Thanks

Upvotes: 3

Views: 109

Answers (1)

CodeWithCoffee
CodeWithCoffee

Reputation: 1904

Issue was because :

There are some params I have defined in Home view file and it was not there in main.php which should be mentioned there and that is reason when you creating $model = new home('search'), it gives error of extension.

So, I have added it and now it is working fine for me.

Thanks.

Upvotes: 3

Related Questions