mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 02:14:26 +02:00
Fix inhertiance implementation for $smarty.block.child
This commit is contained in:
@@ -76,6 +76,7 @@ class BlockCompiler extends Base {
|
|||||||
$compiler->getParser()->lex->taglineno
|
$compiler->getParser()->lex->taglineno
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
$compiler->_cache['blockParams'][$compiler->_cache['blockNesting']]['callsChild'] = true;
|
||||||
$compiler->has_code = true;
|
$compiler->has_code = true;
|
||||||
$compiler->suppressNocacheProcessing = true;
|
$compiler->suppressNocacheProcessing = true;
|
||||||
|
|
||||||
|
@@ -22,12 +22,16 @@ class BlockClose extends Inheritance {
|
|||||||
{
|
{
|
||||||
[$_attr, $_nocache, $_buffer, $_has_nocache_code, $_className] = $this->closeTag($compiler, ['block']);
|
[$_attr, $_nocache, $_buffer, $_has_nocache_code, $_className] = $this->closeTag($compiler, ['block']);
|
||||||
|
|
||||||
|
$_block = [];
|
||||||
|
if (isset($compiler->_cache['blockParams'])) {
|
||||||
|
$_block = $compiler->_cache['blockParams'][$compiler->_cache['blockNesting']] ?? [];
|
||||||
|
unset($compiler->_cache['blockParams'][$compiler->_cache['blockNesting']]);
|
||||||
|
}
|
||||||
|
|
||||||
$_name = $_attr['name'];
|
$_name = $_attr['name'];
|
||||||
$_assign = $_attr['assign'] ?? null;
|
$_assign = $_attr['assign'] ?? null;
|
||||||
unset($_attr[ 'assign' ], $_attr[ 'name' ]);
|
unset($_attr[ 'assign' ], $_attr[ 'name' ]);
|
||||||
|
|
||||||
$_block = [];
|
|
||||||
|
|
||||||
foreach ($_attr as $name => $stat) {
|
foreach ($_attr as $name => $stat) {
|
||||||
if ((is_bool($stat) && $stat !== false) || (!is_bool($stat) && $stat !== 'false')) {
|
if ((is_bool($stat) && $stat !== false) || (!is_bool($stat) && $stat !== 'false')) {
|
||||||
$_block[ $name ] = 'true';
|
$_block[ $name ] = 'true';
|
||||||
|
Reference in New Issue
Block a user