在layout.html.twig文件中;
{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
{{ 'layout.logged_in_as'|trans({'%username%': app.user.username}, 'FOSUserBundle') }} |
<a href="{{ path('fos_user_security_logout') }}">
{{ 'layout.logout'|trans({}, 'FOSUserBundle') }}
</a>
{% else %}
<a href="{{ path('fos_user_security_login') }}">{{ 'layout.login'|trans({}, 'FOSUserBundle') }}</a>
{% endif %}
什么是布局属性?它似乎输出了我在html页面中的字符串,即'layout.logged_in_as'和'layout.logout'
答案 0 :(得分:4)
这些是Symfony捆绑包常见的翻译密钥
以下是the layout
translation definitions that would be translated to English:
layout:
logout: 'Log out'
login: 'Log in'
register: Register
logged_in_as: 'Logged in as %username%'