public function actionAdd() { $model = new AddPageForm(); $model->availableTypes = Page::getPageTypes(); if ($model->load(Yii::$app->request->post()) && $model->validate()) { return $this->redirect(['edit', 'type' => $model->type]); } return $this->render('add', ['model' => $model]); }
public function actionAdd() { $this->adminOnly(); $model = new AddPageForm(); $model->availableTypes = ContainerPage::getPageTypes(); if ($model->load(Yii::$app->request->post()) && $model->validate()) { return $this->redirect($this->contentContainer->createUrl('edit', ['type' => $model->type])); } return $this->render('add', ['model' => $model]); }