uwetews
2016-02-20 22:00:19 +01:00
parent 4530a8232f
commit b39f561083

View File

@@ -54,21 +54,21 @@ Smarty 3.1.30
The tags {assign}, {append} direct assignments like {$foo = ...}, {$foo[...]= ...} support The tags {assign}, {append} direct assignments like {$foo = ...}, {$foo[...]= ...} support
the following optional scope attributes: the following optional scope attributes:
scope=parent - the variable will be assigned in the current template and if the template scope='parent' - the variable will be assigned in the current template and if the template
was included by {include} the calling template was included by {include} the calling template
scope=tpl_root - the variable will be assigned in the current template and if the template scope='tpl_root' - the variable will be assigned in the current template and if the template
was included by {include} the outermost root template was included by {include} the outermost root template
scope=smarty - the variable will be assigned in the current template and the Smarty object scope='smarty' - the variable will be assigned in the current template and the Smarty object
scope=global - the variable will be assigned in the current template and as Smarty object scope='global' - the variable will be assigned in the current template and as Smarty object
global variable global variable
scope=root - the variable will be assigned in the current template and if a data object was scope='root' - the variable will be assigned in the current template and if a data object was
used for variable definitions in the data object or in the Smarty object otherwise used for variable definitions in the data object or in the Smarty object otherwise
scope=local - this scope has only a meaning if the tag is called within a template {function}. scope='local' - this scope has only a meaning if the tag is called within a template {function}.
The variable will be assigned in the local scope of the template function and the The variable will be assigned in the local scope of the template function and the
template which did call the template function. template which did call the template function.
The scope attribute can be combined with the new option flag 'bubble_up' like The scope attribute can be combined with the new option flag 'bubble_up' like
{$foo = 'bar' scope=global bubble_up} {$foo = 'bar' scope='global' bubble_up}
In addition to the assignments according to the scope attributes tpl_root, smarty, global, root the varibale In addition to the assignments according to the scope attributes tpl_root, smarty, global, root the varibale
will also be assigned in all templates in the call chain from template root to the current template, will also be assigned in all templates in the call chain from template root to the current template,
including all local template function scopes of nested template function calls. including all local template function scopes of nested template function calls.
@@ -81,7 +81,7 @@ Smarty 3.1.30
{include 'sub.tpl'} {include 'sub.tpl'}
sub.tpl: sub.tpl:
{$foo = 'bar' scope=global bubble_up} {$foo = 'bar' scope='global' bubble_up}
Will assign the variable 'foo' with value 'bar' as Smarty global variable, in 'sub.tpl' and in Will assign the variable 'foo' with value 'bar' as Smarty global variable, in 'sub.tpl' and in
'main.tpl' because the 'bubble_up' option. 'main.tpl' because the 'bubble_up' option.