2017-03-01 166 views
0

什麼可以,爲密碼重置覆蓋模板,登錄所有工程okey,相同重置否。FosUserBundle覆蓋模板重置

class CmsBundle extends Bundle 
{ 
    public function getParent() 
    { 
     return 'FOSUserBundle'; 
    } 
} 

// CmsBundle /資源/視圖/ FOSUserBundle /重置/ 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

getParent()的/ return 'FOSUserBundle';擴展可能並不如果您將這些文件放入應用程序/目錄中,則需要:app/Resources/FOSUserBundle/views/Resetting/request.html.twig

另外,Resetting/reset_content.html.twig應該只是純HTML,而不是{% block ... %}