Hi,
I have a Gridview with update ButtonColumn,
[b]actionUpdate:
[/b]
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,
));
}
[b]
[/b]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));
}