CodeExplorer getVersionStrategy example
public function getUrl(string
$path): string
{ if ($this->
isAbsoluteUrl($path)) { return $path;
} $url =
$path;
if ($url &&
$url[0
] !== '/'
) { $url = '/' .
$url;
} $url =
$this->
getVersionStrategy()->
applyVersion($this->
appendThemePath($url) .
$url);
if ($this->
isAbsoluteUrl($url)) { return $url;
} return $this->
getBaseUrl($path) .
$url;
} private function appendThemePath(string
$url): string
{ $currentRequest =
$this->requestStack->
getMainRequest();
public function getUrl(string
$path): string
{ if ($this->
isAbsoluteUrl($path)) { return $path;
} if (null !==
$this->sslPackage &&
$this->
getContext()->
isSecure()) { return $this->sslPackage->
getUrl($path);
} $url =
$this->
getVersionStrategy()->
applyVersion($path);
if ($this->
isAbsoluteUrl($url)) { return $url;
} if ($url && '/' !=
$url[0
]) { $url = '/'.
$url;
} return $this->
getBaseUrl($path).
$url;
}