34 function smarty_block_repeat($params, $content, \Smarty_Internal_Template $template, &$repeat) {
35 if (!empty($content)) {
36 $intCount = intval($params[
'count']);
38 $template->trigger_error(
"block: negative 'count' parameter");
43 for ($i=0; $i<$intCount; $i++) {
44 $index = $i + intval($params[
'startindex']);
45 if (isset($params[
'strformat'])) {
46 $indexStr = sprintf($params[
'strformat'], $index);
51 $strRepeat .= str_replace(
'{$index}', $indexStr, $content);
53 if (isset($params[
'separator']) && $i<$intCount-1) {
54 $strRepeat .= $params[
'separator'];
58 if (!empty($params[
'assign'])) {
59 $template->assign($params[
'assign'], $strRepeat);