title: Saving HTML to database with Symfony-2.0 form component
body: <p>I am trying to save HTML content with the Symfony2 form system but I am facing issues with escaping.</p>
  
  <p>My addPost action looks like this</p>
  
  <pre><code>$em = $this-&gt;getDoctrine()-&gt;getEntityManager();
  
  $post = new Post();
  $postForm = $this-&gt;createForm(new PostFormType(), $post);
  
  if ($request-&gt;getMethod() == 'POST') {
     $postForm-&gt;bindRequest($request);
  
     if($postForm-&gt;isValid()){
        $em-&gt;persist($post);
        $em-&gt;flush();
     }
  }
  </code></pre>
  
  <p>The problem is that the post form has a content textarea that allows the user to enter html. When the form is submitted with html like <code>&lt;a href="#"&gt;test&lt;/a&gt;</code> the content gets saved to the database as <code>&lt;a href=\"#\"&gt;test&lt;/a&gt;</code>. And then on each subsequent save the backslashes escape themselves again and again...</p>
  
  <p>What is the proper way to store HTML with the Symfony2 form component?</p>