Trait ConfigurableTrait
Methods summary
public
Charcoal\Config\ConfigurableTrait
|
#
setConfig( mixed $config )
Sets the object's configuration container.
Sets the object's configuration container.
Parameters
- $config
- The Config object, datamap, or filepath.
Returns
Throws
InvalidArgumentException If the parameter is invalid.
|
public
mixed
|
#
config( string|null $key = null, mixed $default = null )
Gets the object's configuration container or a specific key from the container.
Gets the object's configuration container or a specific key from the container.
Parameters
- $key
- If provided, the data key to retrieve.
- $default
- The fallback value to return if $key does not exist.
Returns
mixed If $key is NULL, the Config object is returned.
If $key is given, its value on the Config object is returned.
If the value of $key is NULL, the value of $default is returned.
|
protected
Charcoal\Config\ConfigInterface
|
#
createConfig( mixed $data = null )
Create a new ConfigInterface instance for the object.
Create a new ConfigInterface instance for the object.
Parameters
- $data
- Initial data. Either a filepath, a datamap, or a Config object.
Returns
See
|