Skip to content

Commit 939fff1

Browse files
committed
Allow assetUrl() to use cns easier.
1 parent c60a959 commit 939fff1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/View/Helper/UrlHelper.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function script($path, array $options = [])
146146
*
147147
* @param string|array $path Path string or URL array
148148
* @param array $options Options array. Possible keys:
149-
* `fullBase` Return full URL with domain name
149+
* `fullBase` Return full URL with domain name. Bool or string.
150150
* `pathPrefix` Path prefix for relative URLs
151151
* `ext` Asset extension to append
152152
* `plugin` False value will prevent parsing path as a plugin
@@ -196,7 +196,8 @@ public function assetUrl($path, array $options = [])
196196
$path = $this->_encodeUrl($webPath);
197197

198198
if (!empty($options['fullBase'])) {
199-
$path = rtrim(Router::fullBaseUrl(), '/') . '/' . ltrim($path, '/');
199+
$fullBaseUrl = is_string($options['fullBase']) ? $options['fullBase'] : Router::fullBaseUrl();
200+
$path = rtrim($fullBaseUrl, '/') . '/' . ltrim($path, '/');
200201
}
201202

202203
return $path;

0 commit comments

Comments
 (0)