cvs: smarty / NEWS /libs Smarty_Compiler.class.php

From: Date: Sun, 20 Apr 2003 13:04:42 +0000
Subject: cvs: smarty / NEWS /libs Smarty_Compiler.class.php
Groups: php.smarty.cvs 
Request: Send a blank email to php-smarty-cvs+get-538@lists.php.net to get a copy of this message
messju Sun Apr 20 09:04:42 2003 EDT Modified files: /smarty NEWS /smarty/libs Smarty_Compiler.class.php Log: added &$repeat-paramter to block-functions Index: smarty/NEWS diff -u smarty/NEWS:1.344 smarty/NEWS:1.345 --- smarty/NEWS:1.344 Sat Apr 19 06:32:05 2003 +++ smarty/NEWS Sun Apr 20 09:04:42 2003 @@ -1,3 +1,4 @@ + - added &$repeat-paramter to block-functions (messju) - enabled hex-constants in function.math.php (messju) - enabled hex-constants (0x...) as function-attributes, inside if-statements and as modifier-parameters (messju) Index: smarty/libs/Smarty_Compiler.class.php diff -u smarty/libs/Smarty_Compiler.class.php:1.212 smarty/libs/Smarty_Compiler.class.php:1.213 --- smarty/libs/Smarty_Compiler.class.php:1.212 Sat Apr 19 06:12:18 2003 +++ smarty/libs/Smarty_Compiler.class.php Sun Apr 20 09:04:42 2003 @@ -39,7 +39,7 @@ * @package Smarty */ -/* $Id: Smarty_Compiler.class.php,v 1.212 2003/04/19 10:12:18 messju Exp $ */ +/* $Id: Smarty_Compiler.class.php,v 1.213 2003/04/20 13:04:42 messju Exp $ */ class Smarty_Compiler extends Smarty { @@ -646,14 +646,16 @@ $arg_list[] = "'$arg_name' => $arg_value"; } - $output = "<?php \$this->_tag_stack[] = array('$tag_command', array(".implode(',', (array)$arg_list).")); ".$this->_compile_plugin_call('block', $tag_command).'(array('.implode(',', (array)$arg_list)."), null, \$this); ob_start(); ?>"; + $output = "<?php \$this->_tag_stack[] = array('$tag_command', array(".implode(',', (array)$arg_list).')); '; + $output .= $this->_compile_plugin_call('block', $tag_command).'(array('.implode(',', (array)$arg_list).'), null, $this, $_block_repeat=true);'; + $output .= 'while ($_block_repeat) { ob_start(); ?>'; } else { - $output = "<?php \$this->_block_content = ob_get_contents(); ob_end_clean(); "; - $out_tag_text = $this->_compile_plugin_call('block', $tag_command)."(\$this->_tag_stack[count(\$this->_tag_stack)-1][1], \$this->_block_content, \$this)"; - if($tag_modifier != '') { - $this->_parse_modifiers($out_tag_text, $tag_modifier); - } - $output .= 'echo ' . $out_tag_text . ';'; + $output = '<?php $this->_block_content = ob_get_contents(); ob_end_clean(); '; + $_out_tag_text = $this->_compile_plugin_call('block', $tag_command).'($this->_tag_stack[count($this->_tag_stack)-1][1], $this->_block_content, $this, $_block_repeat=false)'; + if ($tag_modifier != '') { + $this->_parse_modifiers($_out_tag_text, $tag_modifier); + } + $output .= 'echo '.$_out_tag_text.'; } '; $output .= " array_pop(\$this->_tag_stack); ?>"; } @@ -1820,7 +1822,6 @@ } } - /** * load pre- and post-filters

« previous php.smarty.cvs (#538) next »