mirror of
https://github.com/Mibew/mibew.git
synced 2025-03-01 01:24:32 +03:00
Add "default" argument to "Settings::get" method
This commit is contained in:
parent
be7d49c0f5
commit
a37018aab6
@ -136,13 +136,17 @@ class Settings
|
|||||||
* Get setting value.
|
* Get setting value.
|
||||||
*
|
*
|
||||||
* @param string $name Variable's name
|
* @param string $name Variable's name
|
||||||
|
* @param mixed $default A value which will be used if the variable is not
|
||||||
|
* set.
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public static function get($name)
|
public static function get($name, $default = null)
|
||||||
{
|
{
|
||||||
$instance = self::getInstance();
|
$instance = self::getInstance();
|
||||||
|
|
||||||
return $instance->settings[$name];
|
return isset($instance->settings[$name])
|
||||||
|
? $instance->settings[$name]
|
||||||
|
: $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user