title: How do I display Symfony 2 form errors using the Symfony 2 validation component within a silex app?
body: <p><strong>Background</strong>: I'm using Symfony Forms and Symfony Validation components to render a form in my applications registration page in my Silex application. </p>
  
  <p>I have the form working correctly, rendering, client side validation and binding data to my entities. I've added a validation method to the entity which correctly validates the entity and produces the expected errors.</p>
  
  <p><strong>Question</strong>: I now want to get the errors out of the returned ConstraintValidationList and back into the form to display them on the front end using the twig {{ form_errors }} view helper. </p>
  
  <p>I've consulted the API docs at: <a href="http://api.symfony.com/2.0/Symfony/Component/Form/Form.html" rel="nofollow">http://api.symfony.com/2.0/Symfony/Component/Form/Form.html</a> and can't see the correct method for doing this. Does anyone know how to achieve what I'm looking for? </p>
  
  <p>Here is the code from my Silex controller closure:</p>
  
  <pre><code>$app-&gt;post('/register-handler', function(Request $request) use($app)
  {
      // Empty domain object 
      $user = new MppInt\Entity\User();
  
      // Create the form, passing in a new form object and the empty domain object
      $form = $app['form.factory']-&gt;create(new MppInt\Form\Type\RegisterType(), $user);
  
      // Bind the request data to the form which puts it into the underlying domain object
      $form-&gt;bindRequest($request);   
  
      // Validate the domain object using a set of validators.
      // $violations is a ConstraintValidationList
      $violations = $app['validator']-&gt;validate($user);
  
      // Missing step - How do I get a ConstraintValidationList back into the 
      // form to render the errors in the twig template using the {{ form_errors() }}
      // Helper. 
  
  });
  </code></pre>