最佳答案
在 Symfony 2模板中(使用 Twig) ,如何有效地检查用户是否未登录?
我不想用 ROLE
检查。我想要一个简单的方法来检查用户是否没有登录。
我知道将 app.user.username
和 anon
进行比较是可行的,但是我就是感觉不对劲。