Commit a0f9a6d7 by Qiang Xue

Fixes #2937

parent fcd7974f
......@@ -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,
]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment