lithium\action\Dispatcher::config()
Used to set configuration parameters for the Dispatcher
.
Parameters
-
array
$config
Possible key settings are
'classes'
which sets the class dependencies forDispatcher
(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
arrayIf no parameters are passed, returns an associative array with the current
configuration, otherwise returns null
.
Source
public static function config(array $config = []) {
if (!$config) {
return ['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};
}
}
}