added better comments to arr class.

This commit is contained in:
Taylor Otwell 2011-09-21 22:00:06 -05:00
parent 0c4018ec88
commit 8711bb3d85
2 changed files with 12 additions and 4 deletions

View File

@ -73,7 +73,7 @@
<p> <p>
You have successfully installed the Laravel framework. Laravel is a simple framework You have successfully installed the Laravel framework. Laravel is a simple framework
to help web artisans create beautiful, creative applications using elegant, expressive that helps web artisans create beautiful, creative applications using elegant, expressive
syntax. You'll love using it. syntax. You'll love using it.
</p> </p>

View File

@ -1,12 +1,20 @@
<?php namespace Laravel; <?php namespace Laravel; use Closure;
use Closure;
class Arr { class Arr {
/** /**
* Get an item from an array. * Get an item from an array.
* *
* "Dot" notation may be used to dig deep into the array.
*
* <code>
* // Get the $array['user']['name'] value from the array
* $name = Arr::get($array, 'user.name');
*
* // Return a default from if the specified item doesn't exist
* $name = Arr::get($array, 'user.name', 'Taylor');
* </code>
*
* @param array $array * @param array $array
* @param string $key * @param string $key
* @param mixed $default * @param mixed $default