mirror of
https://github.com/laravel/laravel.git
synced 2025-02-20 11:53:14 +08:00
adding some comments to the router class.
This commit is contained in:
parent
fd42e0ca40
commit
af24e8db45
@ -78,6 +78,9 @@ class Router {
|
|||||||
*/
|
*/
|
||||||
public static function find($name)
|
public static function find($name)
|
||||||
{
|
{
|
||||||
|
// --------------------------------------------------------------
|
||||||
|
// Have we already located this route by name?
|
||||||
|
// --------------------------------------------------------------
|
||||||
if (array_key_exists($name, static::$names))
|
if (array_key_exists($name, static::$names))
|
||||||
{
|
{
|
||||||
return static::$names[$name];
|
return static::$names[$name];
|
||||||
@ -86,6 +89,9 @@ class Router {
|
|||||||
$arrayIterator = new \RecursiveArrayIterator(static::$routes);
|
$arrayIterator = new \RecursiveArrayIterator(static::$routes);
|
||||||
$recursiveIterator = new \RecursiveIteratorIterator($arrayIterator);
|
$recursiveIterator = new \RecursiveIteratorIterator($arrayIterator);
|
||||||
|
|
||||||
|
// --------------------------------------------------------------
|
||||||
|
// Find the named route.
|
||||||
|
// --------------------------------------------------------------
|
||||||
foreach ($recursiveIterator as $iterator)
|
foreach ($recursiveIterator as $iterator)
|
||||||
{
|
{
|
||||||
$route = $recursiveIterator->getSubIterator();
|
$route = $recursiveIterator->getSubIterator();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user