added default option to bundle::option method.
This commit is contained in:
parent
3f2bdb7695
commit
bee2a273bc
|
@ -422,13 +422,19 @@ public static function get($bundle)
|
|||
*
|
||||
* @param string $bundle
|
||||
* @param string $option
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
public static function option($bundle, $option)
|
||||
public static function option($bundle, $option, $default = null)
|
||||
{
|
||||
$bundle = static::get($bundle);
|
||||
|
||||
if ( ! is_null($bundle)) return array_get($bundle, $option);
|
||||
if (is_null($bundle))
|
||||
{
|
||||
return value($default);
|
||||
}
|
||||
|
||||
return array_get($bundle, $option, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -49,6 +49,7 @@ ## Laravel 3.2
|
|||
- `Request::secure` now takes `application.ssl` configuration option into consideration.
|
||||
- Simplified the `paths.php` file.
|
||||
- Only write file caches if number of minutes is greater than zero.
|
||||
- Added `$default` parameter to Bundle::option method.
|
||||
|
||||
<a name="upgrade-3.2"></a>
|
||||
## Upgrading From 3.1
|
||||
|
|
Loading…
Reference in New Issue