mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-28 10:53:40 +03:00
Added default value to the config helper
This commit is contained in:
parent
543c68133d
commit
727391aa8f
1 changed files with 5 additions and 2 deletions
|
@ -15,12 +15,15 @@
|
|||
* Quickly fetch the value of a framework configuration.
|
||||
*
|
||||
* @param string $key Configuration key.
|
||||
* @param mixed $default Default value in case the requested config has no value.
|
||||
*
|
||||
* @return mixed Returns the configuration value.
|
||||
*/
|
||||
function config($key)
|
||||
function config($key, $default = NULL)
|
||||
{
|
||||
$CI = &get_instance();
|
||||
|
||||
return $CI->config->item($key);
|
||||
$value = $CI->config->item($key);
|
||||
|
||||
return $value ?? $default;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue