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

1111. appearing after print sequence - php -

excel - I can't get the attachement of the email PHP -

node.js - Express and Redis - If session exists for this user, don't allow access -