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