symfony - How do I get the entity that represents the current user on a PHP template? -
as answered on question how entity represents current user in symfony2? shows how on controller, how do actual user entity on php template without having send on parameter template?
the far was:
$app->getsession()->getusername();
but gave raw var user name, want user entity.
you can use $app->getuser()
in php template , app.user
in twig template.
Comments
Post a Comment