public function actionCreate() { $model = new PahChartMaster(); if (isset($_POST) && !empty($_POST)) { foreach ($_POST as $k => $v) { $_POST['PahChartMaster'][$k] = $v; } $model->attributes = $_POST['PahChartMaster']; if ($model->save()) { $status = true; $msg = "Data berhasil di simpan "; } else { $msg = CHtml::errorSummary($model); $status = false; } if (Yii::app()->request->isAjaxRequest) { echo CJSON::encode(array('success' => $status, 'msg' => $msg, 'id' => $model->account_code)); Yii::app()->end(); } else { $this->redirect(array('view', 'id' => $model->account_code)); } } $this->render('create', array('model' => $model)); }