Merge branch 'master' of github.com:yiisoft/yii2 into asset-command

This commit is contained in:
Klimov Paul
2013-05-16 20:55:22 +03:00
5 changed files with 13 additions and 5 deletions

View File

@ -45,6 +45,9 @@ class YiiBaseTest extends TestCase
Yii::setAlias('@yii', null);
$this->assertFalse(Yii::getAlias('@yii', false));
$this->assertEquals('/yii/gii/file', Yii::getAlias('@yii/gii/file'));
Yii::setAlias('@some/alias', '/www');
$this->assertEquals('/www', Yii::getAlias('@some/alias'));
}
public function testGetVersion()

View File

@ -287,7 +287,11 @@ class YiiBase
if ($path !== null) {
$path = strncmp($path, '@', 1) ? rtrim($path, '\\/') : static::getAlias($path);
if (!isset(self::$aliases[$root])) {
self::$aliases[$root] = $path;
if ($pos === false) {
self::$aliases[$root] = $path;
} else {
self::$aliases[$root] = array($alias => $path);
}
} elseif (is_string(self::$aliases[$root])) {
if ($pos === false) {
self::$aliases[$root] = $path;

View File

@ -26,8 +26,9 @@ class Toolbar extends Widget
$url = Yii::$app->getUrlManager()->createUrl($this->debugAction, array(
'tag' => Yii::getLogger()->tag,
));
$this->view->registerJs("yii.debug.load('$id', '$url');");
$this->view->registerAssetBundle('yii/debug');
$view = $this->getView();
$view->registerJs("yii.debug.load('$id', '$url');");
$view->registerAssetBundle('yii/debug');
echo Html::tag('div', '', array(
'id' => $id,
'style' => 'display: none',

View File

@ -122,7 +122,7 @@ class LinkPager extends Widget
{
$buttons = array();
$pageCount = $this->pagination->pageCount;
$pageCount = $this->pagination->getPageCount();
$currentPage = $this->pagination->getPage();
// first page

View File

@ -63,7 +63,7 @@ class ListPager extends Widget
*/
public function run()
{
$pageCount = $this->pagination->pageCount;
$pageCount = $this->pagination->getPageCount();
$currentPage = $this->pagination->getPage();
$pages = array();