mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-03 19:30:49 +02:00
- bugfix change of 11.03.2014 cause again {capture} data could not been seen in other templates with {$smarty.capture.name} https://github.com/smarty-php/smarty/issues/153
This commit is contained in:
@@ -37,6 +37,13 @@ class Smarty_Internal_Runtime_Capture
|
||||
*/
|
||||
private $countStack = array();
|
||||
|
||||
/**
|
||||
* Named buffer
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
private $namedBuffer = array();
|
||||
|
||||
/**
|
||||
* Flag if callbacks are registered
|
||||
*
|
||||
@@ -84,7 +91,6 @@ class Smarty_Internal_Runtime_Capture
|
||||
{
|
||||
$this->countStack[] = $this->captureCount;
|
||||
$this->captureCount = 0;
|
||||
$_template->_cache[ 'capture' ] = array();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,7 +111,7 @@ class Smarty_Internal_Runtime_Capture
|
||||
if (isset($append)) {
|
||||
$_template->append($append, ob_get_contents());
|
||||
}
|
||||
$_template->_cache[ 'capture' ][ $buffer ] = ob_get_clean();
|
||||
$this->namedBuffer[ $buffer ] = ob_get_clean();
|
||||
} else {
|
||||
$this->error($_template);
|
||||
}
|
||||
@@ -133,7 +139,7 @@ class Smarty_Internal_Runtime_Capture
|
||||
*/
|
||||
public function getBuffer(Smarty_Internal_Template $_template, $name)
|
||||
{
|
||||
return isset($_template->_cache[ 'capture' ][ $name ]) ? $_template->_cache[ 'capture' ][ $name ] : null;
|
||||
return isset($this->namedBuffer[ $name ]) ? $this->namedBuffer[ $name ] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user