summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Wisselink <s.wisselink@iwink.nl>2024-02-02 23:16:51 +0100
committerSimon Wisselink <s.wisselink@iwink.nl>2024-02-05 14:09:44 +0100
commit94d9861d295c3002e9c83699040303bedb3f703d (patch)
tree1e19dd9acf0f0f4520ed930ec6dd6a4f5ceddab9
parent63ff7d81e0dc99d0f2017aaa5e0a3cde6993b6a3 (diff)
downloadsmarty-94d9861d295c3002e9c83699040303bedb3f703d.tar.gz
smarty-94d9861d295c3002e9c83699040303bedb3f703d.tar.bz2
smarty-94d9861d295c3002e9c83699040303bedb3f703d.zip
added Link to variable scope page in the documentation for the assign tag
Fixes #878
-rw-r--r--CHANGELOG.md1
-rw-r--r--docs/designers/language-builtin-functions/language-function-assign.md6
2 files changed, 5 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ea79a572..967989b1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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)
diff --git a/docs/designers/language-builtin-functions/language-function-assign.md b/docs/designers/language-builtin-functions/language-function-assign.md
index 518e3f7d..abcc8e5a 100644
--- a/docs/designers/language-builtin-functions/language-function-assign.md
+++ b/docs/designers/language-builtin-functions/language-function-assign.md
@@ -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 |
@@ -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`.