Answer the question
In order to leave comments, you need to log in
How to get values of all fields from DB in related tables?
Please tell me how to be?
I have a table with products, properties and another table links them.
I want to do as in the video from Maxim Timofeev about the Select2 extension.
In the video he selects via ArrayHelper:map i.e. key and value.
Everything would be fine, but I need this drop-down list to contain not just "id" and "name", but also the value of other fields. How can I do that?
Answer the question
In order to leave comments, you need to log in
If I understand the problem correctly, then:
ArrayHelper::map($array, 'id', function ($element){
return $element['name']. ' ' . $element['paramName'];
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question