How to programmatically select an option in a dropDownList?

I have the following dropDownList:

I want to select a default owner by its id ([font="Courier New"]$owner_id[/font]) when creating a new [font="Courier New"][color="#a0522d"]$model[/color][/font].

The owners appear in the drop down list but how do I [font="Franklin Gothic Medium"]programmatically[/font] select the one I want?

in controller before post


$model->owner_id= '2';

and in view


<?= $form->field($model, 'owners')->dropDownList(

Owner::getOwnerList(),

[

'multiple' => 'multiple','initialize' =>true,

]

)?>



Thank you rups g, that works perfectly!!