我正在尝试在我的树枝模板中显示登录用户的用户名.
$token = new UsernamePasswordToken($user->getUsername(),$user->getPassword(),"secured_area",$user->getRoles()); $this->get("security.context")->setToken($token); $session->set('_security_secured_area',serialize($token));
我想提出类似的东西:
<div class='Meta'>Logged in as <b>username_here</b>
在我的模板顶部.