Skip to content

Commit

Permalink
Improved to support aliases. Fixes yiisoft#2240.
Browse files Browse the repository at this point in the history
  • Loading branch information
vova07 committed Jan 31, 2014
1 parent 3bdbb40 commit efaaec1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions framework/web/AssetManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ public function setConverter($value)
*/
public function publish($path, $options = [])
{
$path = Yii::getAlias($path);

if (isset($this->_published[$path])) {
return $this->_published[$path];
}
Expand Down Expand Up @@ -291,6 +293,8 @@ public function publish($path, $options = [])
*/
public function getPublishedPath($path)
{
$path = Yii::getAlias($path);

if (isset($this->_published[$path])) {
return $this->_published[$path][0];
}
Expand All @@ -315,6 +319,8 @@ public function getPublishedPath($path)
*/
public function getPublishedUrl($path)
{
$path = Yii::getAlias($path);

if (isset($this->_published[$path])) {
return $this->_published[$path][1];
}
Expand Down

0 comments on commit efaaec1

Please sign in to comment.