title: How To Display HTML Tags Saved In Database Using Symfony 2 and Twig
body: <p>I've managed to build a page that will display data from the database dynamically. However, this code which is saved in the database:</p>
  
  <pre><code>&lt;p&gt;This is the content for the radio &lt;a href="#"&gt;page&lt;/a&gt;.&lt;/p&gt;
  </code></pre>
  
  <p>Displays like this:</p>
  
  <pre><code>&lt;p&gt;This is the content for the radio &lt;a href="#"&gt;page&lt;/a&gt;.&lt;/p&gt;
  </code></pre>
  
  <p>The HTML tags aren't rendered. I understand that Symfony (for security purposes) renders any HTML code like this for security reasons. I want Symfony (obviously) to render these HTML tags. How can I achieve this just for this purpose only, so that Symfony still sanitises any HTML tag that is saved to the database elsewhere on the site?</p>
  
  <p>For your information as well, this is the code that I am using to pull the data from the database:</p>
  
  <pre><code>    public function mainpageAction($slug)
  {
  
      $content = $this-&gt;getDoctrine()
          -&gt;getRepository('SiteMainBundle:Content')
          -&gt;find($slug);
  
      if (!$content) {
          throw $this-&gt;createNotFoundException('No product found for slug '.$slug);
      }
  
      return $this-&gt;render('SiteMainBundle:Default:page.html.twig', array('content' =&gt; $content, 'slug' =&gt; $slug));
  }
  </code></pre>
  
  <p>Also, just so I can learn more about Symfony, is the rendering of the HTML tags just the sole job of PHP or could it be rendered properly using Twig?</p>
  
  <p>Many thanks!</p>