rest\Controller $enableCsrfValidation

$enableCsrfValidation public property Whether to enable CSRF validation for the actions in this controller. CSRF validation is enabled only when both this property and yii\web\Request::$enableCsrfValidation are true. Whether to enable CSRF validation for the actions in this controller. CSRF validation is enabled only when both this property and yii\web\Request::$enableCsrfValidation are true. public boolean $enableCsrfValidation = false

rest\Controller $serializer

$serializer public property The configuration for creating the serializer that formats the response data. public string|array $serializer = 'yii\rest\Serializer'

rest\ActiveController verbs()

verbs() protected method Declares the allowed HTTP verbs. Please refer to \yii\rest\VerbFilter::actions on how to declare the allowed verbs. protected array verbs ( )return array The allowed HTTP verbs.

rest\Controller afterAction()

afterAction() public method This method is invoked right after an action is executed. The method will trigger the EVENT_AFTER_ACTION event. The return value of the method will be used as the action return value. If you override this method, your code should look like the following: public function afterAction($action, $result) { $result = parent::afterAction($action, $result); // your custom code here return $result; } public mixed afterAction ( $action, $result )$action yii\

rest\ActiveController actions()

actions() public method Declares external actions for the controller. This method is meant to be overwritten to declare external actions for the controller. It should return an array, with array keys being action IDs, and array values the corresponding action class names or action configuration arrays. For example, return [ 'action1' => 'app\components\Action1', 'action2' => [ 'class' => 'app\components\Action2', 'property1' => 'value1', 'property

rest\ActiveController $modelClass

$modelClass public property The model class name. This property must be set. public string $modelClass = null

rest\ActiveController checkAccess()

checkAccess() public method Checks the privilege of the current user. This method should be overridden to check whether the current user has the privilege to run the specified action against the specified data model. If the user does not have access, a yii\web\ForbiddenHttpException should be thrown. public void checkAccess ( $action, $model = null, $params = [] )$action string The ID of the action to be executed $model object The model to be accessed. If null, it means no specific mod

rest\ActiveController $updateScenario

$updateScenario public property The scenario used for updating a model. See also yii\base\Model::scenarios(). public string $updateScenario = \yii\base\Model::SCENARIO_DEFAULT

rest\ActiveController init()

init() public method Initializes the object. This method is invoked at the end of the constructor after the object is initialized with the given configuration. public void init ( )

rest\Action findModel()

findModel() public method Returns the data model based on the primary key given. If the data model is not found, a 404 HTTP exception will be raised. public yii\db\ActiveRecordInterface findModel ( $id )$id string The ID of the model to be loaded. If the model has a composite primary key, the ID must be a string of the primary key values separated by commas. The order of the primary key values should follow that returned by the primaryKey() method of the model. return yii\db\ActiveRecor