From 767a49f54b5efbf208ddfa2fc1cb10b27f4b4f22 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 8 Jul 2011 06:35:42 -0700 Subject: [PATCH] Tweaking comments in URL class. --- system/url.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/system/url.php b/system/url.php index a9f23f57..1105f6d8 100644 --- a/system/url.php +++ b/system/url.php @@ -19,8 +19,8 @@ class URL { $base = Config::get('application.url'); - // Assets live in the public directory, so we only want to append - // the index file if the URL is to an asset. + // Assets live in the public directory, and should not have + // the index file appended to their URLs. if ( ! $asset) { $base .= '/'.Config::get('application.index'); @@ -60,6 +60,10 @@ class URL { /** * Generate a URL from a route name. * + * For routes that have wildcard parameters, an array may be passed as the + * second parameter to the method. The values of this array will be used + * to fill the wildcard segments of the route URI. + * * @param string $name * @param array $parameters * @param bool $https @@ -69,13 +73,10 @@ class URL { { if ( ! is_null($route = Route\Finder::find($name))) { - // Get the first URI assigned to the route. $uris = explode(', ', key($route)); $uri = substr($uris[0], strpos($uris[0], '/')); - // Replace any parameters in the URI. This allows the dynamic creation of URLs - // that contain parameter wildcards. foreach ($parameters as $parameter) { $uri = preg_replace('/\(.+?\)/', $parameter, $uri, 1);