/** * Creates a new CmsRecipesCategories model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new CmsRecipesCategories(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['index']); } else { $languages = Lang::find()->all(); $languageDefault = Lang::findOne(['default' => 1]); return $this->render('create', ['model' => $model, 'languages' => $languages, 'languageDefault' => $languageDefault]); } }