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

From: Date: Wed, 01 Aug 2007 13:34:39 +0000
Subject: cvs: smarty / NEWS /libs Smarty_Compiler.class.php
Groups: php.smarty.cvs 
Request: Send a blank email to php-smarty-cvs+get-2255@lists.php.net to get a copy of this message
mohrt Wed Aug 1 13:34:39 2007 UTC Modified files: /smarty NEWS /smarty/libs Smarty_Compiler.class.php Log: add append feature to capture http://cvs.php.net/viewvc.cgi/smarty/NEWS?r1=1.557&r2=1.558&diff_format=u Index: smarty/NEWS diff -u smarty/NEWS:1.557 smarty/NEWS:1.558 --- smarty/NEWS:1.557 Mon Jun 18 14:29:00 2007 +++ smarty/NEWS Wed Aug 1 13:34:39 2007 @@ -1,3 +1,4 @@ +- add append feature to {capture} (jablko, monte) - fix when (un)registering filters with the same method name but different class name (danilo) - fix calling registered objects' methods with an empty argument list http://cvs.php.net/viewvc.cgi/smarty/libs/Smarty_Compiler.class.php?r1=1.397&r2=1.398&diff_format=u Index: smarty/libs/Smarty_Compiler.class.php diff -u smarty/libs/Smarty_Compiler.class.php:1.397 smarty/libs/Smarty_Compiler.class.php:1.398 --- smarty/libs/Smarty_Compiler.class.php:1.397 Fri May 11 13:45:36 2007 +++ smarty/libs/Smarty_Compiler.class.php Wed Aug 1 13:34:39 2007 @@ -26,7 +26,7 @@ * @package Smarty */ -/* $Id: Smarty_Compiler.class.php,v 1.397 2007/05/11 13:45:36 messju Exp $ */ +/* $Id: Smarty_Compiler.class.php,v 1.398 2007/08/01 13:34:39 mohrt Exp $ */ /** * Template compiling class @@ -1222,23 +1222,21 @@ $attrs = $this->_parse_attrs($tag_args); if ($start) { - if (isset($attrs['name'])) - $buffer = $attrs['name']; - else - $buffer = "'default'"; - - if (isset($attrs['assign'])) - $assign = $attrs['assign']; - else - $assign = null; + $buffer = isset($attrs['name']) ? $attrs['name'] : "'default'"; + $assign = isset($attrs['assign']) ? $attrs['assign'] : null; + $append = isset($attrs['append']) ? $attrs['append'] : null; + $output = "<?php ob_start(); ?>"; - $this->_capture_stack[] = array($buffer, $assign); + $this->_capture_stack[] = array($buffer, $assign, $append); } else { - list($buffer, $assign) = array_pop($this->_capture_stack); + list($buffer, $assign, $append) = array_pop($this->_capture_stack); $output = "<?php \$this->_smarty_vars['capture'][$buffer] = ob_get_contents(); "; if (isset($assign)) { $output .= " \$this->assign($assign, ob_get_contents());"; } + if (isset($append)) { + $output .= " \$this->append($append, ob_get_contents());"; + } $output .= "ob_end_clean(); ?>"; }

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