// Assume we have the app.php config file as below:
return array(
'version' => '1.1.1',
'email' => array(
'address' => 'chanzonghuang@gmail.com',
);
);
// We can get the config like:
// get all configs in app.php
DI()->config->get('app');
// or one config in app.php
DI()->config->get('app.version'); // return: 1.1.1
// or multi config in app.php
DI()->config->get('app.version.address'); // return: chanzonghuang@gmail.com
Summary
MethodsConstantsget() No constants foundNo protected methods foundN/ANo private methods foundN/A
Methods
get()
get( $key, mixed $default = NULL) : mixed
Get config
Parameters
$key
string config key
mixed
$default
config default value
Returns
mixed
—
config value, or return $default when config not exists