K
K
kranopodem2015-04-07 14:55:57
Yii
kranopodem, 2015-04-07 14:55:57

How to display data in Yii2 in view?

Tell me how to display the necessary data in the View file.
bce92ce51329dfd36e4bbffc6210ee.png
You need to display for each record ( record_id ) its own amount , but when using this code:
<?=$model->lid->amount?>
Only the first entered data is displayed, that is, for lider_id = 1, only 10 will be displayed.
What should be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Makarov, 2015-04-07
@SamDark

It looks like you set the relation between models as hasOne, and you have hasMany there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question