Skip to content

Commit

Permalink
added Link to variable scope page in the documentation for the assign…
Browse files Browse the repository at this point in the history
… tag

Fixes #878
  • Loading branch information
wisskid committed Feb 2, 2024
1 parent 3fff081 commit c0306d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- PHP8.3 support [#925](https://github.com/smarty-php/smarty/issues/925)
- Backlink to GitHub in docs
- Explain how to do escaping and set-up auto-escaping in docs [#865](https://github.com/smarty-php/smarty/issues/865)
- Link to variable scope page in the documentation for the assign tag [#878](https://github.com/smarty-php/smarty/issues/878)

### Fixed
- The {debug} tag was broken in v5 [#922](https://github.com/smarty-php/smarty/issues/922)
Expand Down
Expand Up @@ -8,12 +8,12 @@ execution of a template**.
|----------------|------------|-----------------------------------------------------------------------|
| var | | The name of the variable being assigned |
| value | | The value being assigned |
| scope | (optional) | The scope of the assigned variable: \'parent\',\'root\' or \'global\' |
| scope | (optional) | The scope of the assigned variable: 'parent','root' or 'global' |

## Attributes of the {$var=...} syntax
| Attribute Name | Required | Description |
|----------------|------------|-----------------------------------------------------------------------|
| scope | (optional) | The scope of the assigned variable: \'parent\',\'root\' or \'global\' |
| scope | (optional) | The scope of the assigned variable: 'parent','root' or 'global' |

## Option Flags
| Name | Description |
Expand Down Expand Up @@ -102,6 +102,8 @@ A global variable is seen by all templates.
{$foo="bar" scope="global"}
```

For more information on variable scope, please read the page on [variable scopes](../language-variables/language-variable-scopes.md).

To access `{assign}` variables from a php script use
[`getTemplateVars()`](../../programmers/api-functions/api-get-template-vars.md).
Here's the template that creates the variable `$foo`.
Expand Down

0 comments on commit c0306d9

Please sign in to comment.