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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 01:06:29
Script start
Timing: Jan 30 2025 01:06:29
Module start 'layout'
Timing: Jan 30 2025 01:06:29
Module start 'content'
Timing: Jan 30 2025 01:06:29
Module end 'content'
Timing: Jan 30 2025 01:06:29
Script end

Main resources:

Total runtime0.0164 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 588.1250151.2109
Module start 'layout' 0.00590.0034 739.335936.6484
Module start 'content' 0.00930.0054 775.984490.2500
Module end 'content' 0.01470.0017 866.234429.9922
Script end 0.0164  896.2266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002514.9887140.0002
Check MTime0.00106.3109140.0001
Mysql Total
Database connection0.00074.309810.0007
Mysqli_queries0.003822.866830.0013
Looping result0.00000.066810.0000
Template Total0.00138.010.0013
Template load0.00106.057010.0010
Template processing0.00031.899510.0003
Override
Cache load0.00074.224210.0007
General
dbfile0.00106.129680.0001
String conversion0.00000.042140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs