M
M
Michael2018-03-16 20:12:23
Yii
Michael, 2018-03-16 20:12:23

How to correctly load a repeating model in yii2?

Good day.
There is a model that is duplicated many times, in my case it is a person's name + phone number.
How to load and process correctly in one form .

<? for ($i = 1; $i <= 5; $i++) {
        echo html::textInput('ProjectContact[text'.$i.']','');
        echo html::textInput('ProjectContact[name'.$i.']','');
    } ?>

The output in this form, and then the same loading into the model, I do not consider it correct.
Are there smarter options?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-03-16
@mix_gorbachev

Good evening. Are you talking about tabular input
by any chance ? Specify what exactly do you want to do?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question