DATA Methods

config()

The backends config section allows you to define your own config values. Use this function to dynamically change the values of your config settings. The config values have to be defined in backend prior to using this function. All config values can be used like PHP constants. The value of a constant will remain the same (until you reload the current page) even if the value has been changed by this function.

mixed config( string ident [, mixed value = null ])

Return

Custom config value.

Parameter
Description
identConfig identifier.
valueValue to be stored.

Get constant value

CONFIG_TEST_COUNTER
RETURN: 1043

Read config value

$DATA->config("CONFIG_TEST_COUNTER")
RETURN: 1043

Set config value...

$DATA->config("CONFIG_TEST_COUNTER", intval(CONFIG_TEST_COUNTER) + 1)
RETURN: 1044

...the constant value remains the same...

CONFIG_TEST_COUNTER
RETURN: 1043

...whereas function's value has been updated

$DATA->config("CONFIG_TEST_COUNTER")
RETURN: 1044