Gc\View\Helper\Cdn::__invoke PHP Method

__invoke() public method

Generates an url with the given path.
public __invoke ( string $path ) : string
$path string Path
return string Url
    public function __invoke($path)
    {
        if ($this->basePath === null) {
            $scheme = $this->request->getUri()->getScheme();
            if ($this->config->getValue('force_frontend_ssl') or $scheme === 'https') {
                $basePath = $this->config->getValue('secure_cdn_base_path');
            } else {
                $basePath = $this->config->getValue('unsecure_cdn_base_path');
            }
            $this->basePath = rtrim($basePath, '/');
        }
        return $this->basePath . '/' . ltrim($path, '/');
    }