title: Symfony 3 - Forms choices: How to set 'disabled' = true on "placeholder"
body: <p>In Symfony 3, I want the 'placeholder' of a select list menu to appear before any selection is made but to not appear (or not being select-able) among the list of available options for the user.</p>
  
  <p>The function buildForm() of my MyEntityType, extending AbstractType looks like this:</p>
  
  <pre><code>public function buildForm(FormBuilderInterface $builder, array $options)
    {
  
      $list = array([array with choices values and descriptions]);
      $builder
      -&gt;add('description',TextType::class, array('label'=&gt;'trans.my_desc'))
    -&gt;add('list',ChoiceType::class,array(
      'label'=&gt;'trans.my_list',
      'multiple'=&gt;false,
      'choices'=&gt;$list,
      'placeholder'=&gt;'trans.do_a_choice',
      //'placeholder_in_choices'=&gt;false //this option is not available
  )
  -&gt;add('submit',SubmitType::class,array('label'=&gt;'trans.validate'));
  
    }
  </code></pre>
  
  <p>When I look at the doc, I see that there is a boolean option placeholder_in_choices (<a href="http://symfony.com/doc/current/reference/forms/types/choice.html#field-variables" rel="nofollow noreferrer">http://symfony.com/doc/current/reference/forms/types/choice.html#field-variables</a>) but this option cannot be set in the [array of options for list] which is under "->add('list',ChoiceType::class,array([array of options for list])" (it throws an error explaining that 'placeholder_in_choices' is not an available option).</p>
  
  <p>Thru my search I found this already existing question close to mine: <a href="https://stackoverflow.com/questions/28854164/symfony-how-to-disable-the-default-option">Symfony how to disable the default option</a></p>
  
  <p>After reading thru it, I've tried to implement the finishView() function in MyEntityType class:</p>
  
  <pre><code> public function finishView(FormView $view, FormInterface $form, array $options){
  
      var_dump($view-&gt;children['list']-&gt;vars);
  
     foreach ($view-&gt;children['list']-&gt;vars['choices'] as $sma) {
          if ($sma-&gt;value == "") {
              $sma-&gt;attr['disabled'] = 'disabled';
          }
     }
  }
  </code></pre>
  
  <p>The problem is that, as it is shown in the var_dump(), $view->children['list']->vars['choices'] does not include the 'placeholder' value or label (trans.do_a_choice), it is not possible hence to attach a 'disabled' attribute to it.</p>
  
  <p>Does anyone has a clue how to have 'trans.do_a_choice' to be displayed as placeholder in the select menu but to not appear (or not being select-able) in the options list?</p>