added default option to bundle::option method.

This commit is contained in:
Taylor Otwell 2012-04-18 20:47:29 -05:00
parent 3f2bdb7695
commit bee2a273bc
2 changed files with 9 additions and 2 deletions

View File

@ -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);
}
/**

View File

@ -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