Skip to content
miroshnikov edited this page Mar 17, 2015 · 1 revision

#count modifier description |count

Count all elements in an array or own properties in an object.

Parameter Position Required Default Description
1 No false If this parameter is set to true, ```
{$a = ['a','b','c','d']}
{$a|count}               //== 4

{$person = [name=>[first=>'John',last=>'Doe'], age=>36]}
{$person|count}          //== 2
{$person|count:1}        //== 4

Clone this wiki locally