M
M
Mors Clamor2019-10-12 23:21:43
Yii
Mors Clamor, 2019-10-12 23:21:43

Yii2 REST how to return result from 2 tables?

Hello. I have so far 3 tables - user, userInfo and posts with data for login / profile / and user posts, respectively. When requesting GET api.ru/user, I need to return some of the information from user and userInfo. That is to mix 2 fields from one table to another. How can I do that? After all, with find ()-> all () I get a ready-made array, is it really possible to manually loop through and manually drag fields from another table?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Derepko, 2019-10-12
@66demon666

https://www.yiiframework.com/doc/guide/2.0/en/rest...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question