From 9f8269606fdf51765f6d13de4caac709691b0fea Mon Sep 17 00:00:00 2001 From: praschke Date: Tue, 17 Oct 2023 22:11:29 +0100 Subject: update: set and get --- docs/templates.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'docs') diff --git a/docs/templates.md b/docs/templates.md index e0ea0861..e19309a7 100644 --- a/docs/templates.md +++ b/docs/templates.md @@ -351,7 +351,7 @@ Gets a value from the custom state stack.
Syntax: - {{#get name}}{{/get}} + {{get name}} * _`name`_
The name of the variable to get. @@ -360,7 +360,7 @@ Gets a value from the custom state stack. Example: ```handlebars - {{#get "some-text"}}{{/get}} + {{get "some-text"}} ``` Output: @@ -378,7 +378,7 @@ Assigns a value to the custom state stack. Syntax: {{#set name}}value{{/get}}
- {{#set name value}}{{/get}}
+ {{set name value}}
* _`name`_
The name of the variable to assign. @@ -390,7 +390,7 @@ Assigns a value to the custom state stack. ```handlebars {{#set "some-text"}}This is the value of some-text!{{/set~}} - {{~#set "some-number" 32}}{{/set}} + {{~set "some-number" 32}} ``` Output: @@ -419,14 +419,14 @@ and variable lookups will start from the most recent scope and work backwards un Example: ```handlebars - {{~#set "key" 32}}{{/set~}} - {{~#get "key"}}{{/get~}}, + {{~set "key" 32~}} + {{~get "key"~}}, {{~#scope~}} - {{~#get "key"}}{{/get~}}, - {{~#set "key" 64}}{{/set~}} - {{~#get "key"}}{{/get~}}, + {{~#get "key"~}}, + {{~#set "key" 64~}} + {{~#get "key"~}}, {{~/scope~}} - {{~#get "key"}}{{/get~}} + {{~get "key"~}} ``` Output: -- cgit v1.2.3