title: zf2 create select/drop down box and populate options in controller?
body: <p>To Create a text input box I used folling code in zend framework2</p>
  
  <pre><code>use Zend\Form\Form;
  
  class Loginform extends Form
  {
      public function __construct()
      {
             $this-&gt;add(array(            
              'name' =&gt; 'usernames',
              'attributes' =&gt;  array(
                  'id' =&gt; 'usernames',                
                  'type' =&gt; 'text',
              ),
              'options' =&gt; array(
                  'label' =&gt; 'User Name',
              ),
          ));       
      }
  }
  </code></pre>
  
  <p>and I can populate the values in controller action using </p>
  
  <pre><code>$form = new Loginform();
  $form-&gt;get('usernames')-&gt;setAttribute('value', 'user 1');
  </code></pre>
  
  <p>Any idea how can I do the same for Selection/drop down box in zf2?</p>
  
  <p>Ref: <a href="http://packages.zendframework.com/docs/latest/manual/en/modules/zend.form.quick-start.html" rel="noreferrer">zend framework 2 documentation</a> </p>