* ------------------------------------------------------------- */ class BlockRepeat implements BlockHandlerInterface { public function handle( $params, $content, Template $template, &$repeat): string { global $gBitSmarty; if( !empty( $content ) ) { $intCount = (int) ( $params['count'] ); if( $intCount < 0 ) { throw new Exception( "block: negative 'count' parameter", ); } $strRepeat = str_repeat( $content, $intCount ); if( !empty( $params['assign'] ) ) { $gBitSmarty->assign($params['assign'], $strRepeat ); } else { echo $strRepeat; } } return ''; } public function isCacheable(): bool { return true; } }