DotsUnited\BundleFu\Bundle::getJsBundleUrl PHP Method

getJsBundleUrl() public method

Get javascript bundle url.
public getJsBundleUrl ( ) : string
return string
    public function getJsBundleUrl()
    {
        $url = $this->getJsCacheUrl();
        if (!$url) {
            $url = $this->getJsCachePath();
            if (!$this->isRelativePath($url)) {
                throw new \RuntimeException('If you do not provide a js cache url, js cache path must be a relative local path...');
            }
            $url = '/' . str_replace(DIRECTORY_SEPARATOR, '/', $url);
        }
        $name = $this->getName();
        if (null === $name) {
            $name = sprintf('bundle_%s', $this->getJsFileList()->getHash());
        } elseif (strpos($name, '%s') !== false) {
            $name = sprintf($name, $this->getJsFileList()->getHash());
        }
        return sprintf("%s/%s.js", $url, $name);
    }