php - Passing data to universal twig file Symfony2 -


i want send user data univeral header file, shown on every page can display "hi, {{ username }}" message.

how can without getting data in controllers of every page?

you can render data totally different controller , action (so 1 place) in twig template using:

{{ render(controller('appbundle:base:myaction')) }} 

you can read on here: https://codedump.io/share/mq3hievaedpd


Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -