|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
reywob Smarty n00b
Joined: 22 Aug 2003 Posts: 3
|
Posted: Fri Aug 22, 2003 6:41 pm Post subject: Compilation of {capture}...{/capture} sections |
|
|
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 |
|
snojrnl Smarty n00b
Joined: 25 Nov 2003 Posts: 2
|
Posted: Tue Nov 25, 2003 4:07 am Post subject: |
|
|
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 |
|
|
|
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
|