I have merged admin into create file by copying the gridview into create.php.
<?php $this->renderPartial('_form', array('model'=>$model)); ?>
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'center-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'name',
array(
'class'=>'CButtonColumn',
),
),
)); ?>
It is saving data but the search functionality of grid view is not functioning. Whereas, the same code of CGridView is functioning in admin.php.
here is my controller:
public function actionCreate()
{
$model=new Center;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['Center']))
{
$model->attributes=$_POST['Center'];
if($model->save())
$this->redirect(array('create','id'=>$model->id));
}
$this->render('create',array(
'model'=>$model,
));
}