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

android - Inheriting from Theme.AppCompat* -

broadcastreceiver - android BOOT_COMPLETED not received if not activity intent-filter -

basic authentication with http post params android -