1
我使用Yii2框架 这是我的行为功能ShippingController
yii2:调用未定义的方法关闭::允许()在denyCallback
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'rules' => [
// deny all POST requests
// [
// 'actions' => ['index', 'create'],
// 'allow' => TRUE,
// ],
[
'actions' => ['index', 'create', 'init'],
'allow' => true,
'roles' => ['?'],
'matchCallback' => function ($rule, $action)
{
return $action->controller->redirect('action');
}
],
'denyCallback' => function ($rule, $action)
{
return $action->controller->redirect('not');
}
// everything else is denied
],
],
];
}
matchCallback的工作不错,但在denyCallback
我有这个错误:
错误 调用未定义的方法关闭::允许()
我的问题是什么???!规则阵列的外面