PHP Classes

File: libs/Twig/doc/tests/iterable.rst

Recommend this page to a friend!
  Classes of william amed   Raptor 2   libs/Twig/doc/tests/iterable.rst   Download  
File: libs/Twig/doc/tests/iterable.rst
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Raptor 2
Framework that takes routes from annotations
Author: By
Last change:
Date: 8 years ago
Size: 463 bytes
 

Contents

Class file image Download
``iterable`` ============ .. versionadded:: 1.7 The iterable test was added in Twig 1.7. ``iterable`` checks if a variable is an array or a traversable object: .. code-block:: jinja {# 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 %}