title: Yii2 dropDownList mark option selected
body: <p>Hi i'm trying to make a drop down list with selected value but there is still no progress, drop down is rendenering but always first option is selected.</p>
  
  <pre><code>$company_id = (int) $params['company_id'];
  $options = [
      'options' =&gt; [
           $company_id =&gt; [
              'selected' =&gt; 'selected',
              'label' =&gt; 'test'
          ]
       ]
  ];
  echo $form-&gt;field($model, 'company_id')-&gt;dropDownList($companies_list, $options);
  </code></pre>
  
  <p>whats wrong with that code? I edited my code and i set 'label' => 'test' in my option, and this works, but selected still not</p>
  
  <p>Ok solution found, in framework code i found in renderSelectionOptions method :</p>
  
  <pre><code>$attrs = isset($options[$key]) ? $options[$key] : [];
  $attrs['value'] = (string) $key;
  $attrs['selected'] = $selection !== null &amp;&amp;
      (!is_array($selection) &amp;&amp; !strcmp($key, $selection)
      || is_array($selection) &amp;&amp; in_array($key, $selection));
  </code></pre>
  
  <p>so all what i need to do is :</p>
  
  <pre><code>$model-&gt;company_id = $company_id;
  </code></pre>
  
  <p>before rendering section</p>