Browse Source

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

tags/2.0.0-beta
Klimov Paul 12 years ago
parent
commit
c676e92d74
  1. 3
      tests/unit/framework/YiiBaseTest.php
  2. 4
      yii/YiiBase.php
  3. 5
      yii/debug/Toolbar.php
  4. 2
      yii/widgets/LinkPager.php
  5. 2
      yii/widgets/ListPager.php

3
tests/unit/framework/YiiBaseTest.php

@ -45,6 +45,9 @@ class YiiBaseTest extends TestCase
Yii::setAlias('@yii', null); Yii::setAlias('@yii', null);
$this->assertFalse(Yii::getAlias('@yii', false)); $this->assertFalse(Yii::getAlias('@yii', false));
$this->assertEquals('/yii/gii/file', Yii::getAlias('@yii/gii/file')); $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() public function testGetVersion()

4
yii/YiiBase.php

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

5
yii/debug/Toolbar.php

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

2
yii/widgets/LinkPager.php

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

2
yii/widgets/ListPager.php

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

Loading…
Cancel
Save