Forums / Setup & design / Operator for Array size

Operator for Array size

Author Message

Roberto Frascarelli

Thursday 29 September 2005 9:58:29 am

Hi all,
I was very surprised for the disappearing of the <b>counts</b> array operator in templates.
The previous existance is documented in my one year old ezbook, but now it doesn't work in 3.6.2 CMS version.
How can I calculate array size now ?
Thanks in advance

Ɓukasz Serwatka

Thursday 29 September 2005 11:47:43 am

Roberto, use "count" operator

{def $my_array=array( 1, 2, 3, 4, 5, 6 )}

{$my_array|count}

returns 6

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog