Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Compilation of {capture}...{/capture} sections

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
reywob
Smarty n00b


Joined: 22 Aug 2003
Posts: 3

PostPosted: Fri Aug 22, 2003 6:41 pm    Post subject: Compilation of {capture}...{/capture} sections Reply with quote

Hi,

I'd like the recognition of an extra attribute to the {capture} tag - append="true/false". I'm having to hack the compiler for my current site because I need it to append to any existing content within the variable.

My untested modification to function _compile_capture_tag in Smarty_Compiler.class.php:
[php:1:92b70aad58]<?php
if ($append === true) {
$output = "<?php \$this->_smarty_vars['capture'][$buffer] .= ob_get_contents(); ";
if (isset($assign)) {
$output .= " \$this->append($assign, ob_get_contents());";
}
} else {
$output = "<?php \$this->_smarty_vars['capture'][$buffer] = ob_get_contents(); ";
if (isset($assign)) {
$output .= " \$this->assign($assign, ob_get_contents());";
}
}
?>[/php:1:92b70aad58]
Back to top
View user's profile Send private message Visit poster's website
snojrnl
Smarty n00b


Joined: 25 Nov 2003
Posts: 2

PostPosted: Tue Nov 25, 2003 4:07 am    Post subject: Reply with quote

Thank you! I too am in need of "append" functionality in the capture tag ... devs, any chance that this could be added in CVS for the next version?

--csb
SnowJournal.com
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP