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.

see: http://symfony.com/doc/current/book/security.html


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -