title: How to display global variable in twig?
body: <p>Controller  </p>
  
  <pre><code>$count_em =  $this-&gt;getDoctrine()-&gt;getRepository('AppBundle:St_Jude_Email');
      $count_dql = $count_em-&gt;createQueryBuilder('c')
              -&gt;select('count(c.flag)')
              -&gt;where('c.flag = 0');
      $flag_count = $count_dql-&gt;getQuery();
      $count = $flag_count-&gt;getSingleScalarResult();
  
      return $count;
  </code></pre>
  
  <p>Config.yml</p>
  
  <pre><code> Twig:
    globals:  
      count: '@AppBundle\Controller\countMail'
  </code></pre>
  
  <p>How to display count which is global in twig?? 
  I'm sorry, I'm new to the symfony and have no idea how to display 'count' in twig.
  I tried doing {{ count }} , but got error 'An exception has been thrown during the rendering of a template ("Catchable Fatal Error: Object of class AppBundle\Controller\countMail could not be converted to string").'</p>