controllers/DefaultController.php
public function actionProjectcreate()
    {
        $model = new Project();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['projectview', 'id' => $model->id]);
        } else {
            return $this->render('projectcreate', [
                'model' => $model,
            ]);
        }
    }
public function actionProjectcreate()
    {
        $model = new Project();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['projectview', 'id' => $model->id]);
        } else {
            return $this->render('projectcreate', [
                'model' => $model,
            ]);
        }
    }
public function actionProjectcreate ( ) { $ model = new Project ( ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> save ( ) ) { return $ this -> redirect ( [ 'projectview' , 'id' => $ model -> id ] ) ; } else { return $ this -> render ( 'projectcreate' , [ 'model' => $ model , ] ) ; } }
Creates a new Projects model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
Creates a new Projects model . If creation is successful the browser will be redirected to the view page .