title: symfony3.4 service container in template
body: <p>I do have defined a service in my MainBundle/MainFunctions/ and in Controller I can call the service. How can I get the service container in SYMFONY 3.4 in a template now? Read the docs that it is not public anymore. </p>
  
  <pre><code>#view/template.html.php
  &lt;?php $shop_id = $this-&gt;container-&gt;get('main_functions')-&gt;getSessionShopId(); ?&gt;
  </code></pre>
  
  <p>My config.yml</p>
  
  <pre><code>imports:
  - { resource: parameters.yml }
  - { resource: security.yml }
  - { resource: services.yml }
  - { resource: "@FrontendMainBundle/Resources/config/services.yml
  </code></pre>
  
  <p>my FrontendMainBundle/Resources/config/services.yml</p>
  
  <pre><code>services:
      _defaults:
          public: true
      frontend_locale.locale_listener:
          class: Frontend\MainBundle\EventListener\LocaleListener
          arguments: ["%kernel.default_locale%"]
          tags:
              - { name: kernel.event_subscriber }
      main_functions:
          public: true
          class: "%main_functions_class.class%"
          arguments: ['@translator', '@doctrine.orm.entity_manager'....
  </code></pre>
  
  <p>I read the docs that it is not public anymore. But I can't get to main_functions in template. How?</p>
  
  <p>THANKS!!!</p>