Przeglądaj źródła

Stop using the template name as an object

It is a pure string in twig 2.0
Grégoire Paris 8 lat temu
rodzic
commit
8c7a11275e
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      Resources/views/CRUD/list_array.html.twig

+ 3 - 2
Resources/views/CRUD/list_array.html.twig

@@ -8,10 +8,11 @@ For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.
 
 #}
+{% import _self as list %}
 {%  macro render_array(value) %}
     {% for key, val in value %}
         {% if val is iterable %}
-            [{{ key }} => {{ _self.render_array(val) }}}]
+            [{{ key }} => {{ list.render_array(val) }}}]
         {%  else %}
             [{{ key }} => {{ val }}]
         {%  endif %}
@@ -21,5 +22,5 @@ file that was distributed with this source code.
 {% extends admin.getTemplate('base_list_field') %}
 
 {% block field %}
-    {{ _self.render_array(value) }}
+    {{ list.render_array(value) }}
 {% endblock %}