title: Disable some options select in Zend Framework 2
body: <p>I would disable some option's select in Zend Framework 2. I have a select about spoken languages, when the user save a spoken language, I would disable it because he can't save again the same language.</p>
  
  <p>inside LanguageForm.php</p>
  
  <pre><code>    $this-&gt;add(array(
              'name' =&gt; 'languages',
              'attributes' =&gt; array (
                      'class' =&gt; 'form-control',
              ),
              'type'  =&gt; 'select',
              'options' =&gt; array(
                      'label' =&gt; 'Languages',
                       'empty_option' =&gt; 'Select spoken languages',
                       'value_options' =&gt; array(
                                                  1 =&gt; 'English', 
                                                  2 =&gt; 'Spanish', 
                                                  3 =&gt; 'German', 
                                                  4 =&gt; 'Italian'
                                                  .......... continue......
                                          ),
                               )));
  </code></pre>
  
  <p>inside my controller, I tried to do like this, but doesn't work. The function disables the entire select:</p>
  
  <pre><code>$spoken = array (1,2);  
  $form-&gt;get('languages')-&gt;setAttribute('disabled', $spoken);
  </code></pre>
  
  <p>where am I wrong? thanks so much for the help.</p>