The child of yii\rest\Controller
class.
Includes action-classes and a class that describes the format of the response.
For each entity in API, is created one controller, child of ActiveController
.
Contains following additional properties:
$fieldsAttributes
- contains configuration for FieldsFilter.$expandAttributes
- contains configuration for ExpandFilter.$sortAttributes
- contains configuration for SortFilter.$filterAttributes
- contains configuration for ConditionFilter.
Serialize the response of a REST application. The class is registered in the ActiveController
properties.
Used in ActiveController
for correct output of errors.
Overrides method prepareDataProvider()
for add joins (through RelationKeeper
class), add order by (through
SortFilter) and add query conditions (through ConditionFilter).
Overrides method run()
for saving model relations together with model (through RelationSaver
trait).
Overrides method run()
for saving model relations together with model (through RelationSaver
trait).
Action for adding related models to existing model.
Request must contains body parameters for info about related models as relation name => related models ids.
Example:
['comments' => [1, 2, 3], 'tags' => [1, 2]]
Action for removing related models to existing model.
Syntax is same as in LinkAction
.
← Installation | Filters →