Function GetS()

Retrieve a key's value from the current level of the execution context without checking higher levels of the context

Sergey Shurygin avatar
Written by Sergey Shurygin
Updated over a week ago

Use GetS(name) to retrieve the value of the name key from the current level of the execution context if it exists. If the name key in a higher levels of the execution context, it will not be returned.

When using Twig variables to retrieve a key's value, it is impossible to know if the key is located at the current level of the execution context or at a higher level. If you need to get the value of a key located specifically at the current level, use GetS().

How to use

Use the function in the following way:

GetS(name)

Input

  • name: the name of the variable (execution context key) whose value to retrieve.

Output

The value of the name key, or null if the key does not exist.

Examples

GetS("myVar")

See also

Did this answer your question?