Function __global->set_value
Definitions
sources/config.php
- Set the specified situational value to the specified value.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: string
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $name | ID_TEXT | No | No | required parameter | N/A | N/A | The name of the value |
| $value | ?SHORT_TEXT | No | No | required parameter | N/A | N/A | The value (null: delete) |
| $elective_or_lengthy | boolean | No | No | False | N/A | N/A | Whether this value is an elective/lengthy one. Use this for getting & setting if you don't want it to be loaded up in advance for every page view (in bulk alongside other values), or if the value may be more than 255 characters. Performance trade-off: frequently used values should not be elective, infrequently used values should be elective. |
| $fail_ok | boolean | No | No | False | N/A | N/A | Whether to allow failure (outputting a message instead of exiting completely) |
Returns
- The value just set, same as $value (just as a nicety so that Commandr users can see something "happen") (null: the value was deleted)
- Type: ?SHORT_TEXT
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Set the specified situational value to the specified value.
*
* @param ID_TEXT $name The name of the value
* @param ?SHORT_TEXT $value The value (null: delete)
* @param boolean $elective_or_lengthy Whether this value is an elective/lengthy one. Use this for getting & setting if you don't want it to be loaded up in advance for every page view (in bulk alongside other values), or if the value may be more than 255 characters. Performance trade-off: frequently used values should not be elective, infrequently used values should be elective.
* @param boolean $fail_ok Whether to allow failure (outputting a message instead of exiting completely)
* @return ?SHORT_TEXT The value just set, same as $value (just as a nicety so that Commandr users can see something "happen") (null: the value was deleted)
*/
function set_value(string $name, ?string $value, bool $elective_or_lengthy = false, bool $fail_ok = false) : ?string
* Set the specified situational value to the specified value.
*
* @param ID_TEXT $name The name of the value
* @param ?SHORT_TEXT $value The value (null: delete)
* @param boolean $elective_or_lengthy Whether this value is an elective/lengthy one. Use this for getting & setting if you don't want it to be loaded up in advance for every page view (in bulk alongside other values), or if the value may be more than 255 characters. Performance trade-off: frequently used values should not be elective, infrequently used values should be elective.
* @param boolean $fail_ok Whether to allow failure (outputting a message instead of exiting completely)
* @return ?SHORT_TEXT The value just set, same as $value (just as a nicety so that Commandr users can see something "happen") (null: the value was deleted)
*/
function set_value(string $name, ?string $value, bool $elective_or_lengthy = false, bool $fail_ok = false) : ?string
