H
H
hobu4ok912016-09-18 12:26:35
Yii
hobu4ok91, 2016-09-18 12:26:35

How to fetch data from related models using rest API in yii2?

How to fetch data from related models using rest API in yii2?
For example, there is a user model and a profile model, how to get data through a get request for both the user and his profile using the rest controller?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2016-09-18
@mhthnz

You can include related data in fields(), or pass extraFields to the get separated by commas and take the data, more details here:
www.yiiframework.com/doc-2.0/guide-rest-resources....

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question