variable_string_default
Define a variable from another variable name, with a default value if undefined.
⚙️ Compatible targets: Linux
Parameters
Name | Documentation |
---|---|
prefix | The prefix of the variable name. This parameter is required. |
name | The variable to define, the full name will be prefix.name. This parameter is required. |
source_variable | The source variable name. This parameter is required. |
default_value | The default value to use if source_variable is not defined. This parameter is required. |
Example
method: variable_string_default
params:
default_value: VALUE
source_variable: VALUE
prefix: VALUE
name: VALUE
Documentation
To use the generated variable, you must use the form ${prefix.name}
with each name replaced with the parameters of this method.
Be careful that using a global variable can lead to unpredictable content in case of multiple definition, which is implicitly the case when a technique has more than one instance (directive). Please note that only global variables are available within templates.