Update SiteController.php (#61) [skip ci]

This commit is contained in:
Kalinin Alexandr 2016-06-19 16:56:22 +03:00 committed by Alexander Makarov
parent 8129163195
commit ddeab345bb

View File

@ -11,6 +11,9 @@ use app\models\ContactForm;
class SiteController extends Controller
{
/**
* @inheritdoc
*/
public function behaviors()
{
return [
@ -34,6 +37,9 @@ class SiteController extends Controller
];
}
/**
* @inheritdoc
*/
public function actions()
{
return [
@ -47,11 +53,21 @@ class SiteController extends Controller
];
}
/**
* Displays homepage.
*
* @return string
*/
public function actionIndex()
{
return $this->render('index');
}
/**
* Login action.
*
* @return string
*/
public function actionLogin()
{
if (!Yii::$app->user->isGuest) {
@ -67,6 +83,11 @@ class SiteController extends Controller
]);
}
/**
* Logout action.
*
* @return string
*/
public function actionLogout()
{
Yii::$app->user->logout();
@ -74,6 +95,11 @@ class SiteController extends Controller
return $this->goHome();
}
/**
* Displays contact page.
*
* @return string
*/
public function actionContact()
{
$model = new ContactForm();
@ -87,6 +113,11 @@ class SiteController extends Controller
]);
}
/**
* Displays about page.
*
* @return string
*/
public function actionAbout()
{
return $this->render('about');