mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-02 21:31:48 +01:00
- update for PHP 5.4 compatibility
- reformat source to PSR-2 standard
This commit is contained in:
@@ -35,7 +35,7 @@ function smarty_function_counter($params, $template)
|
||||
$counter =& $counters[$name];
|
||||
|
||||
if (isset($params['start'])) {
|
||||
$counter['start'] = $counter['count'] = (int)$params['start'];
|
||||
$counter['start'] = $counter['count'] = (int) $params['start'];
|
||||
}
|
||||
|
||||
if (!empty($params['assign'])) {
|
||||
@@ -45,9 +45,9 @@ function smarty_function_counter($params, $template)
|
||||
if (isset($counter['assign'])) {
|
||||
$template->assign($counter['assign'], $counter['count']);
|
||||
}
|
||||
|
||||
|
||||
if (isset($params['print'])) {
|
||||
$print = (bool)$params['print'];
|
||||
$print = (bool) $params['print'];
|
||||
} else {
|
||||
$print = empty($counter['assign']);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ function smarty_function_counter($params, $template)
|
||||
if (isset($params['skip'])) {
|
||||
$counter['skip'] = $params['skip'];
|
||||
}
|
||||
|
||||
|
||||
if (isset($params['direction'])) {
|
||||
$counter['direction'] = $params['direction'];
|
||||
}
|
||||
@@ -70,9 +70,7 @@ function smarty_function_counter($params, $template)
|
||||
$counter['count'] -= $counter['skip'];
|
||||
else
|
||||
$counter['count'] += $counter['skip'];
|
||||
|
||||
return $retval;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
return $retval;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user