In my symfony2 application, I have a getPorfolioUser method that returns a specific user variable.
I look forward to calling
{% if portfolio_user%}
in the branch. I did not understand how I can set this as a global variable, since from the documentation I am impressed with, I can only set fixed elements or services, but not service methods.
Do I have to write an extension or an assistant for this? What is an easy way to do this?
Thanks!
php global-variables symfony service twig
Sebastien
source share