PHP Class yii\rest\Controller

Controller implements the following steps in a RESTful API request handling cycle: 1. Resolving response format (see [[ContentNegotiator]]); 2. Validating request method (see Controller::verbs). 3. Authenticating user (see [[\yii\filters\auth\AuthInterface]]); 4. Rate limiting (see [[RateLimiter]]); 5. Formatting response data (see Controller::serializeData). For more details and usage information on Controller, see the guide article on rest controllers.
Since: 2.0
Author: Qiang Xue ([email protected])
Inheritance: extends yii\web\Controller
Afficher le fichier Open project: yiisoft/yii2 Class Usage Examples

Méthodes publiques

Свойство Type Description
$enableCsrfValidation
$serializer the configuration for creating the serializer that formats the response data.

Méthodes publiques

Méthode Description
afterAction ( $action, $result )
behaviors ( )

Méthodes protégées

Méthode Description
serializeData ( mixed $data ) : mixed Serializes the specified data.
verbs ( ) : array Declares the allowed HTTP verbs.

Method Details

afterAction() public méthode

public afterAction ( $action, $result )

behaviors() public méthode

public behaviors ( )

serializeData() protected méthode

The default implementation will create a serializer based on the configuration given by [[serializer]]. It then uses the serializer to serialize the given data.
protected serializeData ( mixed $data ) : mixed
$data mixed the data to be serialized
Résultat mixed the serialized data.

verbs() protected méthode

Please refer to [[VerbFilter::actions]] on how to declare the allowed verbs.
protected verbs ( ) : array
Résultat array the allowed HTTP verbs.

Property Details

$enableCsrfValidation public_oe property

public $enableCsrfValidation

$serializer public_oe property

the configuration for creating the serializer that formats the response data.
public $serializer