$stack
$stack : array
Stack of saved variables
init(\Smarty_Internal_Template $tpl, mixed $from, string $item, boolean $needTotal = false, null|string $key = null, null|string $name = null, array $properties = array()) : mixed
Init foreach loop - save item and key variables, named foreach property data if defined - init item and key variables, named foreach property data if required - count total if required
\Smarty_Internal_Template | $tpl | |
mixed | $from | values to loop over |
string | $item | variable name |
boolean | $needTotal | flag if we need to count values |
null|string | $key | variable name |
null|string | $name | of named foreach |
array | $properties | of named foreach |
$from
restore(\Smarty_Internal_Template $tpl, integer $levels = 1)
Restore saved variables
will be called by {break n} or {continue n} for the required number of levels
\Smarty_Internal_Template | $tpl | |
integer | $levels | number of levels |