Answer the question
In order to leave comments, you need to log in
Exception for as BeforeRequest yii2?
Hello!
In config/main.php there is a block like this:
'as beforeRequest' => [
'class' => 'yii\filters\AccessControl',
'rules' => [
[
'actions' => ['login', 'error'],
'allow' => true,
],
[
'allow' => true,
'roles' => ['admin'],
],
],
],
Answer the question
In order to leave comments, you need to log in
You need to create an exception for AccessControl, for this you need to specify in the except parameter a list of actions to which the filter does not need to be applied
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question