How to save a model->data at actionIndex()?
This is my controller
public function actionIndex()
{
$model=new CompanyLicense();
if($model->checkExpireDate()){
if(isset($_GET['CompanyLicense']))
$model->attributes=$_GET['CompanyLicense'];
$this->render('index',array(
'model'=>$model,
));
}else{
echo 'debug2';
$model->active = 'EXPIRED';
if($model->save())
{
if(isset($_GET['CompanyLicense']))
$model->attributes=$_GET['CompanyLicense'];
$this->render('index',array(
'model'=>$model,
));
}
}
}according my controller, my debugging "debug2" is display. but #model->save is not working. How should I do? or Do I need to do as MySQL stored producer?
Regards
T

Help












