Answer the question
In order to leave comments, you need to log in
How to redo the model -> attributes relationship in the form?
There is a standard way to bind a column from a model to a list of values from another table, for the one-to-many case.
<?=
$form->field($model, 'id')->checkboxList(
\yii\helpers\ArrayHelper::map(DirectoryTypesAds::find()->all(),
"id",
"name"
));
?>
Answer the question
In order to leave comments, you need to log in
Storing id as a string is categorically wrong. Use many-to-many communication and don't reinvent the wheel
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question