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

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

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -