Example #1
0
 public function actionCreate()
 {
     if (\Yii::$app->user->isGuest) {
         throw new ForbiddenHttpException('Access denied');
     }
     $model = new Project();
     if ($model->load(\Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['/project/view', 'id' => $model->getPrimaryKey()]);
     }
     return $this->render('create', ['model' => $model]);
 }