瀏覽代碼

Move macros import to child template for editing form (#4285)

Using template inheritance to get a macro is deprecated and will
no longer be possible in Twig 2.0.
See http://twig.sensiolabs.org/doc/1.x/deprecated.html#macros
Oleksandr Savchenko 8 年之前
父節點
當前提交
12cb94239b
共有 2 個文件被更改,包括 1 次插入1 次删除
  1. 0 1
      Resources/views/CRUD/base_edit.html.twig
  2. 1 0
      Resources/views/CRUD/base_edit_form.html.twig

+ 0 - 1
Resources/views/CRUD/base_edit.html.twig

@@ -30,7 +30,6 @@ file that was distributed with this source code.
 {% block tab_menu %}{{ knp_menu_render(admin.sidemenu(action), {'currentClass' : 'active', 'template': sonata_admin.adminPool.getTemplate('tab_menu_template')}, 'twig') }}{% endblock %}
 
 {% use 'SonataAdminBundle:CRUD:base_edit_form.html.twig' with form as parentForm %}
-{% import "SonataAdminBundle:CRUD:base_edit_form_macro.html.twig" as form_helper %}
 
 {% block form %}
     {{ block('parentForm') }}

+ 1 - 0
Resources/views/CRUD/base_edit_form.html.twig

@@ -1,4 +1,5 @@
 {% block form %}
+    {% import "SonataAdminBundle:CRUD:base_edit_form_macro.html.twig" as form_helper %}
     {{ sonata_block_render_event('sonata.admin.edit.form.top', { 'admin': admin, 'object': object }) }}
 
     {% set url = admin.id(object) is not null ? 'edit' : 'create' %}