| Recommend this page to a friend! |
| Packages of Rafa Rodriguez | Div PHP Template Engine | docs/Features/Aggregate functions.md | Download |
|
|||||||||||||||||||||
The aggregate functions similar to SQL. With this feature you can get some results from list's operations, like as "sum", "average", etc. Think of "aggregate functions" as "list's modifiers", similarly to "variable's modifiers". Syntax in templates
|Aggregate function|Syntax for list of lists/objects|Syntax for array of atomic values|Description| |---|---|---|---| |min|{$min:list-property}|{$min:arrayname}|Minimum "property"| |max|{$max:list-property}|{$max:arrayname}|Maximum "property"| |sum|{$sum:list-property}|{$sum:arrayname}|Sum of "properties"| |avg|{$avg:list-property}|{$avg:arrayname}|Average of "properties"| |count|{$list-property}|{$arrayname}|Count of true "properties"| Example index.php
index.tpl
Output |