From 1463617f13407d4ad215fd6e43f80cd85f0438c7 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 20 Sep 2011 00:11:38 -0500 Subject: [PATCH] added better comments to url->to_route method. --- laravel/url.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/laravel/url.php b/laravel/url.php index ff50e463..ff607aa0 100644 --- a/laravel/url.php +++ b/laravel/url.php @@ -146,11 +146,15 @@ class URL { $uri = substr($uris[0], strpos($uris[0], '/')); + // Spin through each route parameter and replace the route wildcard segment + // with the corresponding parameter passed to the method. foreach ($parameters as $parameter) { $uri = preg_replace('/\(.+?\)/', $parameter, $uri, 1); } + // Before generating the route URL, we will replace all remaining optional + // wildcard segments that were not replaced by parameters with spaces. return $this->to(str_replace(array('/(:any?)', '/(:num?)'), '', $uri), $https); }