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