title: Yii2 - Add additional data attributes to dropDownList() elements and have it selected?
body: <p>Question already exists with answer (below link), but:
  1) doesn't work for me
  2) doesn't include the added need to have a selected option</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/31907590/yii2-how-to-add-additional-attributes-to-dropdownlist-elements">yii2 how to add additional attributes to dropDownList() elements?</a>?</li>
  </ul>
  
  <p>Can help?</p>
  
  <p>IM USING:</p>
  
  <pre><code>&lt;?=$form-&gt;field($invoice, 'id')
          -&gt;dropDownList(ArrayHelper::map($some_items_array, 'value_field', 'show_field'), [
              'options' =&gt; [
                   $some_selected_id =&gt; ['Selected'=&gt;true]],
                   'data' =&gt; ['attrib1' =&gt; "valueA', 'attrib2' =&gt; "valueB']
               'class' =&gt; 'form-control',
               'prompt' =&gt; ''])-&gt;label(false);
   ?&gt;
  </code></pre>
  
  <p>I NEED, BUT DO NOT GET:</p>
  
  <pre><code>&lt;select name="name"&gt;
  
  &lt;option value="value" data-attrib1="valueA" data-attrib2="valueB"&gt;text&lt; option&gt;
  
  &lt;/select&gt;
  </code></pre>