Spec-Zone.ru › Twig 3

iterable

iterable проверяет, является ли переменная массивом или итерируемым объектом:

{# evaluates to true if the foo variable is iterable #}
{% if users is iterable %}
{% for user in users %}
        Hello {{ user }}!
{% endfor %}
{% else %}
{# users is probably a string #}
    Hello {{ users }}!
{% endif %}
« even | null »

© 2009–2018 by the Twig Team
Licensed under the three clause BSD license.
The Twig logo is © 2010–2020 Symfony
https://twig.symfony.com/doc/3.x/tests/iterable.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API