/** * Creates a new Setting model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Setting(); if ($model->load(Yii::$app->request->post())) { $model->name = Setting::encodeName($model->name); if ($model->validate()) { $model->data = HelperData::dataRemoveDoubleReturnsAndTrim($model->data); $model->save(false); return $this->redirect(['view', 'id' => $model->id]); } } $model->data = HelperData::dataExplodeReturn($model->data); return $this->render('create', ['model' => $model]); }