Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Good day.
You can do this (register in the configuration file)
'on beforeAction' => function($event) use ($params) {
if(!Yii::$app->user->can('admin')){
// закрывается доступ для некоторых действий
if(in_array($event->action->id, $params['no_section']))
{
return Yii::$app->response->redirect(['main/default/no-section']);
}
}
return false;
},
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question