/** * Get URL to a public template file that is accessible with the browser. * * @param string $relativePath * @return string */ public static function file($relativePath, $template = true) { if (!$template) { $folder = new \GO\Base\Fs\Folder(\Site::model()->getPublicPath()); $relativePath = str_replace($folder->stripFileStoragePath() . '/files/', '', $relativePath); return \Site::model()->getPublicUrl() . 'files/' . \GO\Base\Util\String::rawurlencodeWithourSlash($relativePath); } else { return self::template()->getUrl() . \GO\Base\Util\String::rawurlencodeWithourSlash($relativePath); } }