Adding and using configuration settings
Appearance
|
ATK Howto: Adding and using configuration settings
|
Adding a new configuration setting can be very useful, and in ATK its very easy. In config.inc.php, just add a line which sets the variable, e.g.: <php $config_foo = 'bar'; </syntaxhighlight>
The variable name must start with $config.
To retrieve variables, either ones you've added or existing ones, use the atkconfig() function and supply the name of the variable you want.
atkconfig("foo");
This would return the variable $config_foo from the config file. Arrays can also be handled in this way. The atkconfig() call can be used from within your module and attribute classes.