How To Use Yii\data\modelserializer With Related Model?


I want to use the yii\data\ModelSerializer for serializing attributes of a model.

This works well for a single model. How do i have to use the ModelSerializer to expand the serialized result with data from a related model?

Do not use this class. It will be removed after I finish the REST api support.

Important to know…thank you!