public function pathToUrl($path)
{
$url = false;
if ($file = $this->path($path)) {
$file = str_replace(DIRECTORY_SEPARATOR, '/', $file);
$root = str_replace(DIRECTORY_SEPARATOR, '/', $this['docs_root']);
$url = '/' . ltrim(str_replace($root, '', $file), '/');
$url = implode('/', array_map('rawurlencode', explode('/', $url)));
}
/*
if ($this->registry['base_port'] != "80") {
$url = $this->registry['site_url'].$url;
}
*/
return $url;
}