Skip to content

Commit

Permalink
Allow assetUrl() to use cns easier.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Dec 27, 2018
1 parent c60a959 commit 939fff1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/View/Helper/UrlHelper.php
Expand Up @@ -146,7 +146,7 @@ public function script($path, array $options = [])
*
* @param string|array $path Path string or URL array
* @param array $options Options array. Possible keys:
* `fullBase` Return full URL with domain name
* `fullBase` Return full URL with domain name. Bool or string.
* `pathPrefix` Path prefix for relative URLs
* `ext` Asset extension to append
* `plugin` False value will prevent parsing path as a plugin
Expand Down Expand Up @@ -196,7 +196,8 @@ public function assetUrl($path, array $options = [])
$path = $this->_encodeUrl($webPath);

if (!empty($options['fullBase'])) {
$path = rtrim(Router::fullBaseUrl(), '/') . '/' . ltrim($path, '/');
$fullBaseUrl = is_string($options['fullBase']) ? $options['fullBase'] : Router::fullBaseUrl();
$path = rtrim($fullBaseUrl, '/') . '/' . ltrim($path, '/');
}

return $path;
Expand Down

0 comments on commit 939fff1

Please sign in to comment.