public function actionCreateQuote() { $model = new Docs(); $model->type = 'quote'; if (isset($_POST['Docs'])) { $model->setX2Fields($_POST['Docs']); if ($model->save()) { $this->redirect(array('view', 'id' => $model->id)); } } $this->render('create', array('model' => $model)); }