title: Yii2. Add icons to DropdownList widget items
body: <p>How to add icons to <code>DropdownList</code> widget items? </p>
  
  <p>I want to have this (fronted-dev took this right from <a href="http://semantic-ui.com" rel="nofollow noreferrer">semantic-ui</a>)</p>
  
  <p><a href="https://i.stack.imgur.com/f7p0i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f7p0i.png" alt="enter image description here"></a></p>
  
  <p>but after using widget it's quite hard to add an icon. </p>
  
  <p>Here is my code and output</p>
  
  <pre><code>&lt;?php $items = [
              '123' =&gt; '&lt;i class="af flag"&gt;&lt;/i&gt;aaa',
              '124' =&gt; 'bbb',
              '345' =&gt; 'ccc',
          ]
          ?&gt;
          &lt;?=$form-&gt;field($model, 'country', [
              'template' =&gt; '{label} &lt;div class="field"&gt;{input}{error}{hint}&lt;/div&gt;',
          ])-&gt;dropDownList($items, ['class' =&gt; 'ui dropdown selection', 'prompt' =&gt; 'Select Country']);?&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/uPfti.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uPfti.png" alt="enter image description here"></a></p>
  
  <p>What code snippet/library could help me to perform this task? I need any implementation, that could be used as <code>ActiveField</code>.</p>
  
  <p><strong>[UPD]</strong></p>
  
  <p><strong><em>scaisEdge</em></strong> option gave this 
  <a href="https://i.stack.imgur.com/KSYl3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KSYl3.png" alt="enter image description here"></a></p>