title: Way to keep "userbar" everywhere
body: <p>I'm new to Symfony2 and I'm amazed by it, but still - I have some problems.</p>
  
  <p>I want to have a userbar displaying common user data (login, avatar, unread messages etc.). My problem is: Do I have to use <code>getDoctrine()</code> in every controller, or is there a way to keep it in one file and include it somehow?</p>
  
  <p>--edit--</p>
  
  <p>I did use <code>{# render #}</code> and now I'm getting... error 101. I did everything <a href="http://symfony.com/doc/master/book/templating.html" rel="nofollow">like in here</a> (section Embedding Controllers).</p>
  
  <p>My code:</p>
  
  <p><code>routing:</code></p>
  
  <pre><code>game_shelf_users_userbar:
      pattern:  /User/userbar/{id}
      defaults: { _controller: GameShelfUsersBundle:Default:index } 
  </code></pre>
  
  <p>excerpt from <code>controller:</code></p>
  
  <pre><code>public function userbarAction() {
          $user = $this-&gt;getDoctrine()
              -&gt;getRepository('GameShelfUsersBundle:User')
              -&gt;findOneById('1');
  
          return $this-&gt;render('GameShelfUsersBundle:Default:userbar.html.twig', array(
              'nick' =&gt; $user-&gt;getNick()
          ));
      }
  </code></pre>
  
  <p><code>userbar.html.twig:</code></p>
  
  <pre><code>&lt;div id="userbar" class="bg grid_5 alpha"&gt;
      &lt;a class="grid_1 omega" href=""&gt;&amp;nbsp;&lt;/a&gt;
      &lt;span class="grid_3 alpha omega"&gt;{{ nick }}&lt;/span&gt;
      &lt;img class="grid_1 alpha" src="img/users/1.jpg" alt=""&gt;
  &lt;/div&gt;
  </code></pre>