Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

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

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    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:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    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