Browse Source

Fixes #1004.

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
f4e3edb1e0
  1. 12
      framework/yii/web/AssetBundle.php

12
framework/yii/web/AssetBundle.php

@ -139,10 +139,18 @@ class AssetBundle extends Object
public function registerAssets($view)
{
foreach ($this->js as $js) {
$view->registerJsFile($this->baseUrl . '/' . ltrim($js, '/'), $this->jsOptions);
if ($js[0] === '/') {
$view->registerJsFile($this->baseUrl . $js, $this->jsOptions);
} else {
$view->registerJsFile($this->baseUrl . '/' . $js, $this->jsOptions);
}
}
foreach ($this->css as $css) {
$view->registerCssFile($this->baseUrl . '/' . ltrim($css, '/'), $this->cssOptions);
if ($css[0] === '/') {
$view->registerCssFile($this->baseUrl . $css, $this->cssOptions);
} else {
$view->registerCssFile($this->baseUrl . '/' . $css, $this->cssOptions);
}
}
}

Loading…
Cancel
Save