overall code refactoring.

This commit is contained in:
Taylor Otwell
2011-06-14 17:27:11 -05:00
parent af24e8db45
commit 30c83f265d
36 changed files with 720 additions and 559 deletions

View File

@@ -52,13 +52,13 @@ class URL {
*/
public static function to_route($name, $parameters = array(), $https = false)
{
if ( ! is_null($route = Router::find($name)))
if ( ! is_null($route = Route\Finder::find($name)))
{
$uris = explode(', ', key($route));
// ----------------------------------------------------
// Get the first URI assigned to the route.
// ----------------------------------------------------
$uris = explode(', ', key($route));
$uri = substr($uris[0], strpos($uris[0], '/'));
// ----------------------------------------------------
@@ -75,6 +75,18 @@ class URL {
throw new \Exception("Error generating named route for route [$name]. Route is not defined.");
}
/**
* Generate a HTTPS URL from a route name.
*
* @param string $name
* @param array $parameters
* @return string
*/
public static function to_secure_route($name, $parameters = array())
{
return static::to_route($name, $parameters, true);
}
/**
* Generate a URL friendly "slug".
*