/** * Creates a new DctSolidFood model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new DctSolidFood(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->dct_solid_food_id]); } else { return $this->render('create', ['model' => $model]); } }
/** * Creates a new DctSolidFood model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new DctSolidFood(); $languages = $this->getLanguages(); $modelLoc = new DctSolidFoodLoc(); if ($model->load(Yii::$app->request->post()) && $model->save()) { $params = Yii::$app->request->post(); DctSolidFoodLoc::saveLocalizationData($model, $params, count($languages)); return $this->redirect(['view', 'id' => $model->dct_solid_food_id]); } else { return $this->render('create', ['model' => $model, 'languages' => $languages, 'modelLoc' => $modelLoc]); } }