title: Access form data in form builder to add custom attribute
body: <p>I'm creating form witch has collection type and collection element has field with data transformer witch is ID to Entity converter:</p>
  
  <pre><code>$builder-&gt;add(
          $builder-&gt;create('template', 'text', array(
              'label' =&gt; false,
              'required' =&gt; false,
              'attr' =&gt; array(
                  'class' =&gt; 'template-selector',
              )
          ))-&gt;addModelTransformer($transformer)
      );
  </code></pre>
  
  <p>This is needed because I want to turn this field to Select2 (javascript lib) ajax powered element.</p>
  
  <p>Problem is that I need to populate Select2 with data, to do this I have have only one reasonable (for performance) option pass data from form builder as attribute (let say data-value) but form builder has any data unless I create element in EventListener but then I cannot add model transformer.</p>
  
  <p>How could I achieve such functionality? Without any additional queries or ajax calls?</p>