Контроллер фильтра
<?
namespace app\controllers;
use yii;
use yii\web\Controller;
use yii\filters\AccessControl;
class BehaviorsController extends Controller
{
public function behaviors()
{
return
[
'access' => [
'class' => AccessControl::className(),
'rules' =>[
[
'allow' => true,
'controllers' => ['SiteController'],
'actions' => ['reg', 'login'],
'verbs' => ['GET', 'POST'],
'roles' => ['?']
],
[
'allow' => true,
'actions' => ['index', 'search']
]
]
]
];
}
}
Сам контроллер SiteController
<?php
namespace app\controllers;
use yii;
use app\models\LoginForm;
use app\models\RegForm;
use app\models\User;
class SiteController extends BehaviorsController
{
/**
* Displays homepage.
*
*
return string
*/
public function actionIndex()
{
return $this->render('index');
}
/**
* Logout action.
*
*
return string
*/
public function actionLogout()
{
Yii::$app->user->logout();
return $this->goHome();
}
}
ошибка: