Hi,
I have a Gridview with update ButtonColumn,
actionUpdate:
Problem is that after $model->save() page don't redirect into actionIndex. what's the reason?
I have similar code for actionCreate and it works well:
actionCreate:
I have a Gridview with update ButtonColumn,
actionUpdate:
public function actionUpdate($id) { $model=$this->loadModel($id); if(isset($_POST['Category'])) { $model->attributes=$_POST['Category']; if($model->save()) $this->redirect(array('index')); } $this->render('_form',array( 'model'=>$model, )); }
Problem is that after $model->save() page don't redirect into actionIndex. what's the reason?
I have similar code for actionCreate and it works well:
actionCreate:
public function actionCreate() { $model=new Category; if(isset($_POST['Category'])) { $model->attributes=$_POST['Category']; if($model->validate()) if($model->save()) $this->redirect(array('index')); } $this->render('_form',array('model'=>$model)); }