/
pashko
/
siec
Обзор
Документация
Войти
/
pashko
/
siec
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
backend/controllers/SiteController.php
71 строка
2 KB
Kokorin Pavel
fixs
26 июл 2020, 10:48
26 июл 2020, 10:48
ef973b0
Код
Авторство
О чём код?
<?php namespace backend\controllers; use common\models\Feedback; use common\models\Mail; use yii\web\Controller; use yii\filters\VerbFilter; use yii\filters\AccessControl; /** * Site controller */ class SiteController extends Controller { /** * {@inheritdoc} */ public function behaviors() { return [ 'access' => [ 'class' => AccessControl::className(), 'rules' => [ [ 'actions' => ['login', 'error'], 'allow' => true, ], [ 'actions' => ['logout', 'index'], 'allow' => true, 'roles' => ['@'], ], ], ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ 'logout' => ['post'], ], ], ]; } /** * {@inheritdoc} */ public function actions() { return [ 'error' => [ 'class' => 'yii\web\ErrorAction', ], ]; } /** * Displays homepage. * * @return string */ public function actionIndex() { $mailCount = Mail::find()->count(); $feedbackCount = Feedback::find()->count(); return $this->render('index', [ 'mailCount' => $mailCount, 'feedbackCount' => $feedbackCount ]); } }