Extends
lithium\core\StaticObject
Used to set configuration parameters for the `Dispatcher`.
Parameters
- array $config Possible key settings are `'classes'` which sets the class dependencies for `Dispatcher` (i.e. `'request'` or `'router'`) and `'rules'`, which sets the pre-processing rules for routing parameters. For more information on the `'rules'` setting, see the `$_rules` property.
Returns
array If no parameters are passed, returns an associative array with the current configuration, otherwise returns `null`.Source
public static function config(array $config = array()) {
if (!$config) {
return array('rules' => static::$_rules);
}
foreach ($config as $key => $val) {
$key = "_{$key}";
if (!is_array($val)) {
static::${$key} = $val;
continue;
}
if (isset(static::${$key})) {
static::${$key} = $val + static::${$key};
}
}
}