- bugfix/enhancement {capture} allow variable as capture block name in Smarty special variable

like $smarty.capture.$foo https://github.com/smarty-php/smarty/issues/478 https://github.com/smarty-php/smarty/pull/481
This commit is contained in:
uwetews
2018-08-26 00:20:31 +02:00
parent 72185fb743
commit 8e09f97a14
3 changed files with 8 additions and 8 deletions

View File

@@ -1,4 +1,9 @@
===== 3.1.33-dev-6 =====
===== 3.1.33-dev-7 =====
26.08.2018
- bugfix/enhancement {capture} allow variable as capture block name in Smarty special variable
like $smarty.capture.$foo https://github.com/smarty-php/smarty/issues/478 https://github.com/smarty-php/smarty/pull/481
===== 3.1.33-dev-6 =====
19.08.2018
- fix PSR-2 coding standards and PHPDoc blocks https://github.com/smarty-php/smarty/pull/452
https://github.com/smarty-php/smarty/pull/475

View File

@@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.33-dev-6';
const SMARTY_VERSION = '3.1.33-dev-7';
/**
* define variable scopes
*/

View File

@@ -43,12 +43,7 @@ class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase
*/
public static function compileSpecialVariable($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter = null)
{
$tag = trim($parameter[ 0 ], '"\'');
$name = isset($parameter[ 1 ]) ? $compiler->getId($parameter[ 1 ]) : null;
if (!$name) {
//$compiler->trigger_template_error("missing or illegal \$smarty.{$tag} name attribute", null, true);
}
return '$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl'.(isset($name)?", '{$name}')":')');
return '$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl'.(isset($parameter[ 1 ])?", {$parameter[ 1 ]})":')');
}
/**