In my symfony2 application, I have a getPorfolioUser method which return a specific user variable.
I am looking forward to be able to call
{%
When you look here : http://symfony.com/doc/current/reference/twig_reference.html#app
You can read this :
The app variable is available everywhere and gives access to many commonly needed objects and values. It is an instance of GlobalVariables.
GlobalVariables is Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables
I never do it but I think one way is to overide this class in order to put your special needs in.