title: How to validate form without entity in controller?
body: <p>I have a basic form to send an email : </p>
  
  <pre><code>&lt;form action="{{ path('user_send_mail') }}" method="post" enctype="multipart/form-data"&gt;
  
    &lt;input name="email_to" type="email" class="form-control" placeholder="To" required&gt;
  
    &lt;input name="email_cc" type="email" class="form-control" placeholder="Cc"&gt;
  
    &lt;textarea name="message" id="email_message" class="form-control" placeholder="message"     style="height: 120px;" required&gt;&lt;/textarea&gt;
  
    &lt;input type="file" name="attachment"/&gt;
  
    &lt;p class="help-block"&gt;Max. 2MB&lt;/p&gt;
  
    &lt;button type="submit" class="btn btn-primary pull-left"&gt;&lt;i class="fa fa-envelope"&gt;&lt;/i&gt; Send the email&lt;/button&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>And an action in my controller to validate the data and send the mail but validation doesn't work..</p>
  
  <pre><code>use Symfony\Component\Validator\Constraints\Email;
  use Symfony\Component\Validator\Constraints\File;
  use Symfony\Component\Validator\Constraints\NotBlank;
  
  public function sendMailToUserAction(Request $request)
  {
          $form = $this-&gt;createFormBuilder(null)
              -&gt;add('email_to', 'email', array(
                  'required' =&gt; true,
                  'constraints' =&gt; new Email()
              ))
              -&gt;add('email_cc', 'email', array(
                  'required' =&gt; false,
                  'constraints' =&gt; new Email()
              ))
              -&gt;add('message', 'textarea', array(
                  'required' =&gt; true,
                  'constraints' =&gt; new NotBlank()
              ))
              -&gt;add('attachment', 'file', array(
                  'required' =&gt; false,
                  'constraints' =&gt; new File()
              ))
              -&gt;getForm();
  
          $form-&gt;handleRequest($request);
  
          if ($form-&gt;isValid()) {
              $data = $form-&gt;getData();
              var_dump($data);exit;
          } else {
              var_dump("error");exit;
          }
  }  
  </code></pre>
  
  <p>When I submit the form, I got always "error", so validation doesn't work but I don't know why... I have read a lot of topics about this but I get stuck..</p>
  
  <p><strong>EDIT :</strong> If I print form error using <code>$form-&gt;getErrorsAsString()</code> instead of <code>var_dump("error");exit;</code>, I got this : </p>
  
  <pre><code>string(97) "email_to: No errors email_cc: No errors message: No errors attachment: No errors "
  </code></pre>