Refactor the URL class.

This commit is contained in:
Taylor Otwell 2011-08-08 10:01:00 -05:00
parent 04a1e44e6e
commit c145e6cbaa
1 changed files with 1 additions and 6 deletions

View File

@ -14,10 +14,7 @@ class URL {
*/
public static function to($url = '', $https = false, $asset = false)
{
if (filter_var($url, FILTER_VALIDATE_URL) !== false)
{
return $url;
}
if (filter_var($url, FILTER_VALIDATE_URL) !== false) return $url;
$base = Config::get('application.url').'/'.Config::get('application.index');
@ -127,13 +124,11 @@ public static function __callStatic($method, $parameters)
{
$parameters = (isset($parameters[0])) ? $parameters[0] : array();
// Dynamically create a secure route URL.
if (strpos($method, 'to_secure_') === 0)
{
return static::to_route(substr($method, 10), $parameters, true);
}
// Dynamically create a route URL.
if (strpos($method, 'to_') === 0)
{
return static::to_route(substr($method, 3), $parameters);