MODX Cloud

The Most Productive MODX Learning Playground Ever

Claim Free Lab Account

xPDO.getOption

Skip to end of metadata
Go to start of metadata


xPDO::getOption

Get an xPDO configuration option value by key.

Syntax

API Docs: http://api.modxcms.com/xpdo/xPDO.html#getOption

mixed getOption (string $key, [array $options = null], [mixed $default = null])

Examples

Get the table prefix:

$tablePrefix = $xpdo->getOption(xPDO_OPT_TABLE_PREFIX);

Get an option from a user-specified array, and if not set, check for it in $xpdo->config. If it's not set there, return false as its default value:

$mySetting = $xpdo->getOption('my_setting',$myConfig,false);

See Also

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.