mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-13 12:49:04 +08:00
Fixes #2937
This commit is contained in:
@@ -10,6 +10,7 @@ namespace yii\web;
|
||||
use Yii;
|
||||
use yii\helpers\Html;
|
||||
use yii\base\InvalidConfigException;
|
||||
use yii\helpers\Url;
|
||||
|
||||
/**
|
||||
* View represents a view object in the MVC pattern.
|
||||
@@ -371,7 +372,7 @@ class View extends \yii\base\View
|
||||
} else {
|
||||
$am = Yii::$app->getAssetManager();
|
||||
$am->bundles[$key] = new AssetBundle([
|
||||
'css' => [$url],
|
||||
'css' => [Url::to($url)],
|
||||
'cssOptions' => $options,
|
||||
'depends' => (array) $depends,
|
||||
]);
|
||||
@@ -432,11 +433,8 @@ class View extends \yii\base\View
|
||||
$this->jsFiles[$position][$key] = Html::jsFile($url, $options);
|
||||
} else {
|
||||
$am = Yii::$app->getAssetManager();
|
||||
if (strpos($url, '/') !== 0 && strpos($url, '://') === false) {
|
||||
$url = Yii::$app->getRequest()->getBaseUrl() . '/' . $url;
|
||||
}
|
||||
$am->bundles[$key] = new AssetBundle([
|
||||
'js' => [$url],
|
||||
'js' => [Url::to($url)],
|
||||
'jsOptions' => $options,
|
||||
'depends' => (array) $depends,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user