Browse Source

Merge pull request #2243 from vova07/2240-am-aliases

2240 am aliases
tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
07be396312
  1. 1
      framework/CHANGELOG.md
  2. 6
      framework/web/AssetManager.php

1
framework/CHANGELOG.md

@ -114,6 +114,7 @@ Yii Framework 2 Change Log
- Enh: Added `yii\web\View::POS_LOAD` (qiangxue)
- Enh: Added `yii\web\Response::clearOutputBuffers()` (qiangxue)
- Enh: Improved `QueryBuilder::buildLimit()` to support big numbers (qiangxue)
- Enh #2240: Improved `yii\web\AssetManager::publish()`, `yii\web\AssetManager::getPublishedPath()` and `yii\web\AssetManager::getPublishedUrl()` to support aliases (vova07)
- Chg #1519: `yii\web\User::loginRequired()` now returns the `Response` object instead of exiting the application (qiangxue)
- Chg #1586: `QueryBuilder::buildLikeCondition()` will now escape special characters and use percentage characters by default (qiangxue)
- Chg #1610: `Html::activeCheckboxList()` and `Html::activeRadioList()` will submit an empty string if no checkbox/radio is selected (qiangxue)

6
framework/web/AssetManager.php

@ -223,6 +223,8 @@ class AssetManager extends Component
*/
public function publish($path, $options = [])
{
$path = Yii::getAlias($path);
if (isset($this->_published[$path])) {
return $this->_published[$path];
}
@ -291,6 +293,8 @@ class AssetManager extends Component
*/
public function getPublishedPath($path)
{
$path = Yii::getAlias($path);
if (isset($this->_published[$path])) {
return $this->_published[$path][0];
}
@ -315,6 +319,8 @@ class AssetManager extends Component
*/
public function getPublishedUrl($path)
{
$path = Yii::getAlias($path);
if (isset($this->_published[$path])) {
return $this->_published[$path][1];
}

Loading…
Cancel
Save