controllers/RequestController.php
/**
     * Creates a new Request model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
Creates a new Request model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
Creates a new Request model . If creation is successful the browser will be redirected to the ' view ' page . @return mixed
public function actionCreate()
    {
        $model = new Request();
        if ( $model->load(Yii::$app->request->post()) ){
            if( $model->validate() && $model->save() ){
                Yii::$app->session->SetFlash('success','Данные приняты');
                return $this->redirect('/site/login');
            }else{
                    Yii::$app->session->SetFlash('error','Есть ошибка');
            }
        }
        return $this->render('create', [
            'model' => $model,
        ]);
    }
public function actionCreate ( ) { $ model = new Request ( ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) ) { if ( $ model -> validate ( ) && $ model -> save ( ) ) { Yii :: $ app -> session -> SetFlash ( 'success' , 'Данные приняты'); return $ this -> redirect ( '/site/login' ) ; } else { Yii :: $ app -> session -> SetFlash ( 'error' , 'Есть ошибка'); } } return $ this -> render ( 'create' , [ 'model' => $ model , ] ) ; }
Creates a new Request model.
Creates a new Request model .
//var_dump(Yii::$app->request->post());