title: Symfony2 - populate navigation bar in layout.html.twig on every page request
body: <p>In my layout.html.twig I have a navigation bar with some links. I want the links to be populated from a database.</p>
  
  <p>For example, in the navigation bar I have a drop down of 'Recent Products'. How can I populate the dropdown in the main layout.html.twig from a database? (of course it'll be cached in the future)</p>
  
  <p>Do I need to create a filter?</p>
  
  <p>Any help would be great. Thanks</p>
  
  <p>Note: In Symfony 1.4 I would have used a component. Does this exist in Symfony 2?</p>