I need an example, from dropDownList, where I can make a dropDown between two sqls, in this case A and B.
Below is a pseudocode.
Introduction to the problem:
Table sql A
id_A
id_usuario
nome_A
descricao_A
Table sql B
id_B
id_A
nome_B
descricao_B
I need to do a dropDownList with sql B, where all sql A fields that have id_usuario = 10
should be displayed, but in sql B I do not have the id_user field, it should be something like inner join, however using the dropDownList of yii2.
The syntax below, which I am using does not resolve, since it only displays the fields which satisfies id_A (sql A and B).
dropDownList(\yii\helpers\ArrayHelper::map(B::find()->where(['id_A' => $A->id_A])->all(),'id_B','nome_B') ,
P.S. I do not want to put the userid in sql B.