added route:destination method.

This commit is contained in:
Taylor Otwell
2012-02-09 23:36:08 -06:00
parent 8737dde682
commit 4330124d79

View File

@@ -218,4 +218,20 @@ class Route {
}));
}
/**
* Extract the URI string from a route destination.
*
* <code>
* // Returns "home/index" as the destination's URI
* $uri = Route::uri('GET /home/index');
* </code>
*
* @param string $destination
* @return string
*/
public static function destination($destination)
{
return trim(substr($destination, strpos($destination, '/')), '/') ?: '/';
}
}