I am trying to display the username of a registered user in my branch template.
Setting a token that works great with firewalls and logs the user into:
$token = new UsernamePasswordToken($user->getUsername(), $user->getPassword(), "secured_area", $user->getRoles()); $this->get("security.context")->setToken($token); $session->set('_security_secured_area', serialize($token));
I want to add something like:
<div class='meta'>Logged in as <b>username_here</b>
at the top of my template.
php symfony twig
skrilled
source share