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