Error when using filter access control what have I done wrong?

Controller filter
namespace app\controllers;

use yii;
use yii\web\Controller;
use yii\filters\AccessControl;

class Controller extends BehaviorsController
{
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']
]

]
]

];
}
}

The controller SiteController

namespace app\controllers;

use yii;

use app\models\LoginForm;
use app\models\RegForm;
use app\models\User;

class SiteController extends BehaviorsController
{

/**
* Displays the homepage.
*
* string
*/
public function actionIndex()
{
return $this->render('index');
}

/**
* Logout action.
*
* string
*/
public function actionLogout()
{
Yii::$app->user->logout();

return $this->goHome();
}
}

error:
ff8f40daeb8642629f52b16c36ef127c.png
July 2nd 19 at 13:51
2 answers
July 2nd 19 at 13:53
Solution
You have a request to the controller misses, didn't really get a grasp of the code, since the error before it apparently. Check the config.
July 2nd 19 at 13:55
Solution
Carelessly written code
'controllers' => ['SiteController'],

and it was necessary
'controllers' => ['Site'],

Find more questions by tags Yii