functtion count in volt

Hi all count($variable)=12(php function) foreach ($variable as $key => $value)

end what is function count equivalent in volt



7.6k

You'll can get this value easy with loop controls : http://docs.phalconphp.com/en/latest/reference/volt.html#loop-context Example :

{% set a = [1,2,3] %}
    {% for val in a %}
    {% if loop.first %}
        {{ loop.length }}
    {% endif %}
    {% endfor %}