function create() { $workflow = new Workflow(); $workflow->name = 'New workflow'; $workflow->save(); return redirect("workflows/edit/{$workflow->id}")->with('status_success', 'Workflow created.'); }
/** * Creates a new Workflow model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Workflow(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->workflow_id]); } else { return $this->render('create', ['model' => $model]); } }