I just got into developing with the Symfony2 framework and I really like it so far - I use the Smarty3 Templating Engine as I already worked with it before, and I am now starting to get into Doctrine for fetching data from a Database.
My question is more a structural one - lets say, I want a navigation / menu on every page that contains elements that are fetched from Doctrine (and not hard coded into the template) - I know, how to use Smarty's "include" and "extends" tags to build up some inheritance, but how would I get the data for the menu?
Lets say, I've got a controller called "detailAction" that passes an array with a description, a title, etc. to a Smarty template - that part of course works like a charm. But where/when exactly would I fetch the data for the menu / the footer / everything that is "shared" on multiple pages? I know I can't put that query into the "detailAction" but rather in something like an "indexAction" - but how would I then connect both the detail template and the index template, as I can only call the "render()" function once?
I really hope this makes sense - can the "forward()" function of Symfony2 help me with this?
Thanks for your help!