Skip to content

Commit

Permalink
update #179
Browse files Browse the repository at this point in the history
  • Loading branch information
uwetews committed Feb 20, 2016
1 parent 4530a82 commit b39f561
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions NEW_FEATURES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,21 @@ Smarty 3.1.30

The tags {assign}, {append} direct assignments like {$foo = ...}, {$foo[...]= ...} support
the following optional scope attributes:
scope=parent - the variable will be assigned in the current template and if the template
was included by {include} the calling 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
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
global variable
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
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
template which did call the template function.
scope='parent' - the variable will be assigned in the current template and if the template
was included by {include} the calling 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
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
global variable
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
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
template which did call the template function.

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
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.
Expand All @@ -81,7 +81,7 @@ Smarty 3.1.30
{include '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
'main.tpl' because the 'bubble_up' option.
Expand Down

2 comments on commit b39f561

@yourchoice
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error for {$foo = 'bar' scope=global bubble_up}" too many shorthand attributes

@uwetews
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error for {$foo = 'bar' scope=global bubble_up}" too many shorthand attributes<

Please note that scope handling has been reworked later at version 3.1.30 and the bubble_up option flags was removed. See NEW_FEATURES.txt

Please sign in to comment.