yii\rest\Controller::behaviors PHP Method

behaviors() public method

public behaviors ( )
    public function behaviors()
    {
        return ['contentNegotiator' => ['class' => ContentNegotiator::className(), 'formats' => ['application/json' => Response::FORMAT_JSON, 'application/xml' => Response::FORMAT_XML]], 'verbFilter' => ['class' => VerbFilter::className(), 'actions' => $this->verbs()], 'authenticator' => ['class' => CompositeAuth::className()], 'rateLimiter' => ['class' => RateLimiter::className()]];
    }

Usage Example

Beispiel #1
1
 public function behaviors()
 {
     $behaviors = parent::behaviors();
     $behaviors['contentNegotiator'] = ['class' => ContentNegotiator::className(), 'formats' => ['application\\json' => Response::FORMAT_JSON]];
     $behaviors['authenticator'] = ['class' => QueryParamAuth::className()];
     return $behaviors;
 }
All Usage Examples Of yii\rest\Controller::behaviors