diff options
Diffstat (limited to 'vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_capture.php')
-rw-r--r-- | vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_capture.php | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_capture.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_capture.php index 69f1ce0cf..80ffa35b2 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_capture.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_capture.php @@ -64,7 +64,9 @@ class Smarty_Internal_Runtime_Capture if (!$this->isRegistered) { $this->register($_template); } - $this->captureStack[] = array($buffer, $assign, $append); + $this->captureStack[] = array($buffer, + $assign, + $append); $this->captureCount ++; ob_start(); } @@ -76,8 +78,10 @@ class Smarty_Internal_Runtime_Capture */ private function register(Smarty_Internal_Template $_template) { - $_template->startRenderCallbacks[] = array($this, 'startRender'); - $_template->endRenderCallbacks[] = array($this, 'endRender'); + $_template->startRenderCallbacks[] = array($this, + 'startRender'); + $_template->endRenderCallbacks[] = array($this, + 'endRender'); $this->startRender($_template); $this->isRegistered = true; } @@ -126,20 +130,24 @@ class Smarty_Internal_Runtime_Capture */ public function error(Smarty_Internal_Template $_template) { - throw new SmartyException("Not matching {capture}{/capture} in \"{$_template->template_resource}\""); + throw new SmartyException("Not matching {capture}{/capture} in '{$_template->template_resource}'"); } /** - * Return content of named capture buffer + * Return content of named capture buffer by key or as array * * @param \Smarty_Internal_Template $_template - * @param $name + * @param string|null $name * - * @return null + * @return string|string[]|null */ - public function getBuffer(Smarty_Internal_Template $_template, $name) + public function getBuffer(Smarty_Internal_Template $_template, $name = null) { - return isset($this->namedBuffer[ $name ]) ? $this->namedBuffer[ $name ] : null; + if (isset($name)) { + return isset($this->namedBuffer[ $name ]) ? $this->namedBuffer[ $name ] : null; + } else { + return $this->namedBuffer; + } } /** |