title: change the priority of selected attribute in listbox
body: <p><strong>Following is the example code :</strong></p>
  
  <p>IN CONTROLLER</p>
  
  <pre><code> foreach($UserTypesArray as $key =&gt; $value)
      {
        $model-&gt;allowed_users[$key] = ['selected' =&gt; 'selected'];
      }
      $model-&gt;htmlOptions = array('multiple' =&gt; 'true', 'options' =&gt;  $model-&gt;allowed_users);
  </code></pre>
  
  <p>IN VIEW</p>
  
  <pre><code>$form-&gt;field($model, 'user_type_id[]')-&gt;listBox($model-&gt;all_users ,  $model-&gt;htmlOptions);
  </code></pre>
  
  <p>OK here we go!</p>
  
  <p>I have searched a lot on "how to make list box with pre selected values from the database"</p>
  
  <p>Two things happened </p>
  
  <p>1) I ended up writing the above code (which has no issue no error, works perfectly)</p>
  
  <p>2) I found out that in htmlOptions the <code>selected="selected"</code> has a low priority so it it gets overwritten and is automatically removed from all <code>option</code> tags</p>
  
  <p>further more if I replace <code>['selected' =&gt; 'selected']</code> with <code>['disabled' =&gt; 'disabled']</code> it works and all the <code>option</code> tags are disabled in the listbox .... As <code>disabled</code> has a higher priority so it gets pushed in the <code>option</code> tag but the <code>selected</code> attribute does not get pushed because of it low priority. </p>
  
  <p>Any one know how to fix that ? </p>