对于密码重置覆盖模板,登录所有工作可能会有什么效果,而不是重置错误。
class CmsBundle extends Bundle
{
public function getParent()
{
return 'FOSUserBundle';
}
}
// CmsBundle / Resources / view / FOSUserBundle / Resetting / request.html.twig
{% extends "@Cms/base.html.twig" %}
{% block fos_user_content %}
{{ include('@Cms/FOSUserBundle/views/Resetting/request_content.html.twig') }}
{% endblock fos_user_content %}
//请求内容
{% block fos_user_content %}
<form action="{{ path('fos_user_resetting_send_email') }}" method="POST" class="fos_user_resetting_request">
<div>
<label for="username">{{ 'Resetting.request.username'|trans }}</label>
<input type="text" id="username" name="username" required="required" />
</div>
<div>
<input type="submit" value="{{ 'Resetting.request.submit'|trans }}" />
</div>
</form>
{% endblock fos_user_content %}
答案 0 :(得分:0)
如果您将文件放入app /目录,则可能不需要getParent()
/ return 'FOSUserBundle';
扩展名:app/Resources/FOSUserBundle/views/Resetting/request.html.twig
。
此外,重置/ reset_content.html.twig应该只是纯HTML,而不是{% block ... %}
。