/** * Creates a new Recipe model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Recipe(); if ($model->load($this->post()) && $model->saveRecipe()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render(['model' => $model]); } }