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