在我的symfony 3.2項目中,我使用FOSUserBundle
進行用戶註冊和身份驗證。我想要做的是將自定義主題應用於註冊表單。Symfony FosUserBundle從我的默認模板擴展到另一個包
所以我做了app/Resources/views/base.html.twig
那是我的應用程序的基本模板:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>{% block title %}Welcome!{% endblock %}</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% block stylesheets %}
<link rel="stylesheet" type="text/css" href="{{asset('assets/vendor/bootstrap/css/bootstrap.css')}}" ></link>
<link rel="stylesheet" type="text/css" href="{{asset('assets/vendor/adminlte/adminlte.css')}}" ></link>
<link rel="stylesheet" type="text/css" href="{{asset('assets/vendor/adminlte/skin-blue.css')}}" ></link>
{% endblock %}
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
{% block javascriptsHeader %}
{% endblock %}
</head>
<body class="{{ classes }}">
{% block body %}
{% endblock body %}
{% block javascriptsFooter %}
{% endblock javascriptsFooter %}
</body>
</html>
我也改變了Resources/FOSUSerBundle/views/layout.html.twig
包含以下內容: * Symfony2: How to extend a Bundle? *:
{% extends AppBundle::base.html.twig %}
{% body %}
{% block fos_user_content %}
{% endblock fos_user_content %}
{% endblock body %}
上看到http://symfony.com/doc/current/bundles/FOSUserBundle/overriding_templates.html
但我得到以下錯誤:
Unexpected token "punctuation" of value ":" ("end of statement block" expected).
你有什麼想法如何使用我的默認模板作爲模板註冊?