Customize Authentication - Login Symfony2 Messages

后端 未结 2 1733
慢半拍i
慢半拍i 2020-12-03 03:09

So I\'m reading the security chapter of Symfony2 Book. I understand everything, but I\'d like to customize the error message if a there is a login error.

In which fi

2条回答
  •  余生分开走
    2020-12-03 04:01

    You can use translation. In parameters.ini set locale to your language and create message file. Then in twig template use:

    {% if error %}
        
    {{ error.message|trans({},'messages') }}
    {% endif %}

提交回复
热议问题