You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to update Smarty in a big legacy project with code like this. It is just a simplfied example which stopped working in v3.1.28.
More precisely the last commit where this was working is 54d54e5.
So these are the changes affecting this behavior 54d54e5...2ba7109
Displays "index". I'd like to propagate "include_base" (see include_base.tpl) without polluting the global/root scope.
include.tpl:
{extends "./include_base.tpl"}
{*$test=$test scope=parent*} {* this also doesn't help because the variable in `include_base.tpl` is assigned later that this code *}
include_base.tpl:
{$test="include_base" scope=parent}
Trying to affect the execution order using blocks
include.tpl:
{extends "./include_base.tpl"}
{block content append}
{$test=$test scope=parent} {* this also doesn't help because the parent of this template is not "index.tpl" *}
{*$smarty.template_object->parent->parent->_assignInScope("test", $test)*} {* this is the only hack i came up with that works *}
{/block}
Is it a bug or an intended behavior? Shouldn't there be a way how to propagate variable to the parent "scope by scope"?.
Our code is legacy and propagation up the tree might even not be a good idea but it is still a BC break that prevents us to update Smarty without fear.
BTW Thanks for everyone who still tries to maintain this library.
The text was updated successfully, but these errors were encountered:
I'd like to update Smarty in a big legacy project with code like this. It is just a simplfied example which stopped working in
v3.1.28
.More precisely the last commit where this was working is 54d54e5.
So these are the changes affecting this behavior
54d54e5...2ba7109
See PR #851
index.tpl
:Displays "index". I'd like to propagate "include_base" (see
include_base.tpl
) without polluting the global/root scope.include.tpl
:include_base.tpl
:Trying to affect the execution order using blocks
include.tpl
:include_base.tpl
:Is it a bug or an intended behavior? Shouldn't there be a way how to propagate variable to the parent "scope by scope"?.
Our code is legacy and propagation up the tree might even not be a good idea but it is still a BC break that prevents us to update Smarty without fear.
BTW Thanks for everyone who still tries to maintain this library.
The text was updated successfully, but these errors were encountered: