src/controllers/SiteController.php
public function actionContact()
    {
        $model = new ContactForm();
        if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) {
            Yii::$app->session->setFlash('contactFormSubmitted');

            return $this->refresh();
        }

        return $this->render('contact', compact('model'));
    }
public function actionContact()
    {
        $model = new ContactForm();
        if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) {
            Yii::$app->session->setFlash('contactFormSubmitted');

            return $this->refresh();
        }

        return $this->render('contact', compact('model'));
    }
public function actionContact ( ) { $ model = new ContactForm ( ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> contact ( Yii :: $ app -> params [ 'adminEmail' ] ) ) { Yii :: $ app -> session -> setFlash ( 'contactFormSubmitted' ) ; return $ this -> refresh ( ) ; } return $ this -> render ( 'contact' , compact ( 'model' ) ) ; }
Displays contact page and sends contact form.
@return string
Displays contact page and sends contact form .