src/base/Controller.php
public function behaviors()
    {
        $behaviors = [
            'access' => [
                'class' => AccessControl::className(),
                'user' => Yii::$app->adminuser,
                'rules' => $this->getRules(),
            ],
        ];
        
        if (!empty($this->apiResponseActions)) {
            $behaviors['negotiator'] = [
                'class' => ContentNegotiator::className(),
                'only' => $this->apiResponseActions,
                'formats' => [
                    'application/json' => Response::FORMAT_JSON,
                ],
            ];
        }
        
        return $behaviors;
    }
public function behaviors()
    {
        $behaviors = [
            'access' => [
                'class' => AccessControl::className(),
                'user' => Yii::$app->adminuser,
                'rules' => $this->getRules(),
            ],
        ];
        
        if (!empty($this->apiResponseActions)) {
            $behaviors['negotiator'] = [
                'class' => ContentNegotiator::className(),
                'only' => $this->apiResponseActions,
                'formats' => [
                    'application/json' => Response::FORMAT_JSON,
                ],
            ];
        }
        
        return $behaviors;
    }
public function behaviors ( ) { $ behaviors = [ 'access' => [ 'class' => AccessControl :: className ( ) , 'user' => Yii :: $ app -> adminuser , 'rules' => $ this -> getRules ( ) , ] , ] ; if ( ! empty ( $ this -> apiResponseActions ) ) { $ behaviors [ 'negotiator' ] = [ 'class' => ContentNegotiator :: className ( ) , 'only' => $ this -> apiResponseActions , 'formats' => [ 'application/json' => Response :: FORMAT_JSON , ] , ] ; } return $ behaviors ; }
Attach the AccessControl filter behavior for the controler.

@return array
Attach the AccessControl filter behavior for the controler .