/** * Creates a new Theme model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $themeModel = new Theme(); $forms = Form::find()->select(['id', 'name'])->asArray()->all(); if ($themeModel->load(Yii::$app->request->post()) && $themeModel->save()) { Yii::$app->getSession()->setFlash('success', Yii::t('app', 'The theme has been successfully created.')); return $this->redirect(['view', 'id' => $themeModel->id]); } else { return $this->render('create', ['themeModel' => $themeModel, 'forms' => $forms]); } }