Skip to content
This repository has been archived by the owner on Mar 28, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1 from crlcu/master
Browse files Browse the repository at this point in the history
Setting::get($key, $default)
  • Loading branch information
angelside committed Jul 19, 2014
2 parents c923174 + 86b4b55 commit b8ca0a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Juy/Setting/Setting.php
Expand Up @@ -16,10 +16,11 @@ class Setting {
* Get setting key to value
*
* @param $key
* @param $default
*
* @return null
*/
public function get($key)
public function get($key, $default = null)
{
try
{
Expand All @@ -38,7 +39,7 @@ public function get($key)
return $arr;
});

return (isset($settings[$key])) ? $settings[$key] : null;
return (isset($settings[$key])) ? $settings[$key] : ( ($default) ? $default : null );
}
catch(\Exception $e)
{
Expand Down

0 comments on commit b8ca0a6

Please sign in to comment.