/** * Creates a new Issue model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Issue(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }
public function actionCreateEmpty() { $model = new Issue(); if ($model->load(\Yii::$app->request->post()) && $model->save()) { $this->saveChecklist($model); $this->sendMessage($model); return $this->redirect(['/issue/index', 'id' => $model->project_id]); } $checklistItems[] = new IssueChecklist(); return $this->render('createEmpty', ['model' => $model, 'checklistItems' => $checklistItems]); }