title: Symfony Twig global variables
body: <p>I'm trying to call some data in my root twig template and used Twig global variables to achieve that.</p>
  
  <p>When I call the service i get this error: </p>
  
  <blockquote>
    <p>Type error: Argument 1 passed to AwarenessBundle\Service\AwarenessService::getLatestNews() must implement interface Doctrine\ORM\EntityManagerInterface, none given, called in /var/www/html/myisms/vendor/twig/twig/lib/Twig/Template.php on line 675</p>
  </blockquote>
  
  <h2>Twig code:</h2>
  
  <pre><code>{{ news_service.getlatestNews() }}
  </code></pre>
  
  <h2>services.yml:</h2>
  
  <pre><code>news.latest:
      class: AwarenessBundle\Service\AwarenessService
      arguments: [ '@doctrine.orm.entity_manager' ]
  </code></pre>
  
  <h2>AwarenessService</h2>
  
  <pre><code>class AwarenessService 
  {
      public function getLatestNews(EntityManagerInterface $em)
      {
          return $em-&gt;getRepository("AwarenessBundle:Feed")
              -&gt;findBy(array(), array('id' =&gt; 'DESC', 10));
      }
  }
  </code></pre>
  
  <p>I'm not sure where my problem is but I have to make my service global and I don't know how to do that. Any help would be appreciated.</p>