-
Notifications
You must be signed in to change notification settings - Fork 715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to assign global scope variables #194
Comments
{assign var="product_template" value="$shareddir/Views/Product" scope="global" bubble_up} for now, read NEW_FEATURES.txt |
Using global scopes is always dangerous as you may loose overview in complex template structures. In your case the safest solution is {assign var="product_template" value="$shareddir/Views/Product" scope="parent"} It will assign the variable just in the calling template, so that it's know when Sub Template 2 is called. All other variable scopes are not touched. |
The fix is now in the master branch. read the NEW_FEATURES.txt for details |
I'm running the latest from the repo pull and have run across a problem. It manifested itself in being unable to pull in a subtemplate. What was odd is that the path, which relies on an assigned global variable, was being assigned in another previous subtemplate. This assignment works fine in 3.1.17 but appears to no longer work in the current version of Smarty
SubTemplate 1
{assign var="product_template" value="$shareddir/Views/Product" scope="global"}
SubTemplate 2 (called after Template 1)
{$product_template}
Produces
If I assign it in each template it works... but this defeats the purpose
The text was updated successfully, but these errors were encountered: