title: Symfony2: setting the default option of a select
body: <p>I have a form with a dropdown (select) and I would like to choose the option selected by default:</p>
  
  <p>This is the code that generates the select:</p>
  
  <pre><code>    $builder-&gt;add('language', 'choice', array(
          'label' =&gt; 'pages.age.gateway.language.label',
          'choices' =&gt; array(1 =&gt; 'first option', 2 =&gt; 'second option'),
      ));
  </code></pre>
  
  <p>I've tried the following (suggested here, <a href="https://stackoverflow.com/questions/8073236/symfony2-setting-a-default-choice-field-selection">Symfony2 Setting a default choice field selection</a>):</p>
  
  <pre><code>    $builder-&gt;add('language', 'choice', array(
          'label' =&gt; 'pages.age.gateway.language.label',
          'choices' =&gt; array(1 =&gt; 'first option', 2 =&gt; 'second option'),
          'data' =&gt; '2'
      ));
  </code></pre>
  
  <p>this didn't work with my code (my understanding of symfony2, I might not be in the right direction).</p>
  
  <p>Another alternative would be using 'preferred_choices' but I'd like to avoid this, as I wouldn't like to modify the order in which the options are displayed.</p>