There is a checkboxlist / radiobuttonlist with response options. The last answer has to be with its own answer, which is written manually.
Example:
The answer option goes into the model and is saved to the general table:
id | id_answer | id_user |
where id_answer
is the ID of the selected answer from the answers table ( id|text_answer
).
id_user
is the user ID of the user who owns the answer
Here is the standard checkbox box:
<?= $form->field($model, 'id_answer')-> checkboxList(Answers::find()->select(['text_answer', 'id_answer ])-> indexBy('id_asnwer')->column(), ?>
How to supplement it with your own answer?
ps: the user’s own answers are planned to be saved in the answers table, but only prepared in advance for the answer option. (or can it be different?)
Answers
table, there assign it an ID and from there into the general table. Or is it better at all? - Zhi V