Added comments to URL class.

This commit is contained in:
Taylor Otwell 2011-07-25 13:22:52 -07:00
parent 7f465f307b
commit d48c5d186d
1 changed files with 2 additions and 0 deletions

View File

@ -21,8 +21,10 @@ public static function to($url = '', $https = false, $asset = false)
$base = Config::get('application.url').'/'.Config::get('application.index'); $base = Config::get('application.url').'/'.Config::get('application.index');
// If the URL is to an asset such as an image, we do not need to go through the front controller.
$base = ($asset) ? str_replace('/'.Config::get('application.index'), '', $base) : $base; $base = ($asset) ? str_replace('/'.Config::get('application.index'), '', $base) : $base;
// If the resource should be accessed over HTTPS, change the protocol in the URL.
$base = ($https and strpos($base, 'http://') === 0) ? 'https://'.substr($base, 7) : $base; $base = ($https and strpos($base, 'http://') === 0) ? 'https://'.substr($base, 7) : $base;
return $base.'/'.ltrim($url, '/'); return $base.'/'.ltrim($url, '/');