list_array.html.twig 638 B

1234567891011121314151617181920212223242526
  1. {#
  2. This file is part of the Sonata package.
  3. (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  4. For the full copyright and license information, please view the LICENSE
  5. file that was distributed with this source code.
  6. #}
  7. {% import _self as list %}
  8. {% macro render_array(value) %}
  9. {% for key, val in value %}
  10. {% if val is iterable %}
  11. [{{ key }} => {{ list.render_array(val) }}}]
  12. {% else %}
  13. [{{ key }} => {{ val }}]
  14. {% endif %}
  15. {% endfor %}
  16. {% endmacro %}
  17. {% extends admin.getTemplate('base_list_field') %}
  18. {% block field %}
  19. {{ list.render_array(value) }}
  20. {% endblock %}