Accessing the logged-in user in a template

前端 未结 3 2003
陌清茗
陌清茗 2020-12-12 12:54

I\'m using FOSuserbundle to get started with User registration https://github.com/FriendsOfSymfony/FOSUserBundle

I\'ve got it registering / logging in and out. What

3条回答
  •  隐瞒了意图╮
    2020-12-12 13:19

    {{ app.user.username|default('') }}

    Just present login username for example, filter function default('') should be nice when user is NOT login by just avoid annoying error message.

提交回复
热议问题