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
Datei anzeigen Open project: yiisoft/yii2 Class Usage Examples

Public Properties

Property Type Description
$enableCsrfValidation
$serializer the configuration for creating the serializer that formats the response data.

Public Methods

Method Description
afterAction ( $action, $result )
behaviors ( )

Protected Methods

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

Method Details

afterAction() public method

public afterAction ( $action, $result )

behaviors() public method

public behaviors ( )

serializeData() protected method

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
return mixed the serialized data.

verbs() protected method

Please refer to [[VerbFilter::actions]] on how to declare the allowed verbs.
protected verbs ( ) : array
return 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