/** * Creates a new Currency model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Currency(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->goBack(); } else { return $this->render('create', ['model' => $model]); } }
/** * Creates a new Currency model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Currency(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { $billing = ArrayHelper::map(Billing::find()->asArray()->all(), 'id', 'name'); return $this->render('create', ['model' => $model, 'billing' => $billing]); } }
/** * Creates a new Currency model. * If creation is successful, the browser will be redirected to the 'index' page. * @return mixed */ public function actionCreate() { $model = new Currency(); if ($model->load(Yii::$app->request->post()) && $model->save()) { Yii::$app->session->setFlash("Currency-success", Yii::t("app", "Currency successfully created")); return $this->redirect(['index']); } else { return $this->render('create', ['model' => $model]); } }