On 20.10.2010, at 12:14, Fabien Potencier wrote: > If we do that, I'm pretty sure that all your points below are taken care of. > >> Injecting custom variables into a 3rd party Bundle: >> ------------------------------------------------------------------- >> >> Now the bigger issue is that how can I get some custom variables into >> my layout. For example to display the menu header. Now one approach >> would be to essentially make an instance of the Bundle controller, >> for example DoctrineUserBundle\SessionController, inside an >> application Controller. Then I could with the above tools simply make >> the layout do nothing, so that I just get the form HTML. Then I can >> then render this HTML with some custom logic into the actual layout >> of my application. >> >> This however means that for every method I want to expose in a 3rd >> party Bundle, I have to write a wrapper method just so that I can >> inject a few things into the layout. Now Maybe there should be an >> event to hook into when a Controller loads a template. My application >> could then connect to this event to do some processing to generate >> various variables necessary inside my applications layout template.
unfortunately not, unless you make the templates call out to other Controllers to get app level config options, dynamic data (MenuBundle etc.) etc. that needs to be embedded in to the layout. the approach of providing an event for this instead is a lot cleaner. regards, Lukas Kahwe Smith [email protected] -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en
