frontend/controllers/SiteController.php
/**
     * Displays contact page.
     *
     * @return mixed
     */
Displays contact page.
@return mixed
Displays contact page . @return mixed
public function actionContact()
    {
        $model = new ContactForm();
        if ($model->load(Yii::$app->request->post()) && $model->sendEmail()) {
            Yii::$app->session->setFlash('success', 'Thank you for contacting us. We will respond to you as soon as possible.');
            return $this->refresh();
        } else {
            Yii::$app->session->setFlash('error', 'There was an error sending your message.');
            return $this->render('contact', [
                'model' => $model,
            ]);
        }
    }
public function actionContact ( ) { $ model = new ContactForm ( ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> sendEmail ( ) ) { Yii :: $ app -> session -> setFlash ( 'success' , 'Thank you for contacting us. We will respond to you as soon as possible.' ) ; return $ this -> refresh ( ) ; } else { Yii :: $ app -> session -> setFlash ( 'error' , 'There was an error sending your message.' ) ; return $ this -> render ( 'contact' , [ 'model' => $ model , ] ) ; } }
Displays contact page.
Displays contact page .