Commit 0df677a0 by Carsten Brandt

Merge branch 'master' of github.com:yiisoft/yii2

* 'master' of github.com:yiisoft/yii2: Fixes #699: fixed wrong usage of self and static Fixed wrong links
parents 676b3669 d0ddb566
...@@ -460,7 +460,7 @@ of the rule class, you need to respect this hierarchy as well. That is why when ...@@ -460,7 +460,7 @@ of the rule class, you need to respect this hierarchy as well. That is why when
the `execute()` method will return true if the user group is either 1 or 2 (meaning the user is in either "admin" the `execute()` method will return true if the user group is either 1 or 2 (meaning the user is in either "admin"
group or "author" group). group or "author" group).
Next, configure `authManager` by listing the two roles in [[yii\rbac\ManagerInterface::defaultRoles]]: Next, configure `authManager` by listing the two roles in [[yii\rbac\BaseManager::$defaultRoles]]:
```php ```php
return [ return [
......
...@@ -54,7 +54,7 @@ class Widget extends Component implements ViewContextInterface ...@@ -54,7 +54,7 @@ class Widget extends Component implements ViewContextInterface
$config['class'] = get_called_class(); $config['class'] = get_called_class();
/** @var Widget $widget */ /** @var Widget $widget */
$widget = Yii::createObject($config); $widget = Yii::createObject($config);
self::$stack[] = $widget; static::$stack[] = $widget;
return $widget; return $widget;
} }
...@@ -67,8 +67,8 @@ class Widget extends Component implements ViewContextInterface ...@@ -67,8 +67,8 @@ class Widget extends Component implements ViewContextInterface
*/ */
public static function end() public static function end()
{ {
if (!empty(self::$stack)) { if (!empty(static::$stack)) {
$widget = array_pop(self::$stack); $widget = array_pop(static::$stack);
if (get_class($widget) === get_called_class()) { if (get_class($widget) === get_called_class()) {
echo $widget->run(); echo $widget->run();
return $widget; return $widget;
...@@ -108,7 +108,7 @@ class Widget extends Component implements ViewContextInterface ...@@ -108,7 +108,7 @@ class Widget extends Component implements ViewContextInterface
public function getId($autoGenerate = true) public function getId($autoGenerate = true)
{ {
if ($autoGenerate && $this->_id === null) { if ($autoGenerate && $this->_id === null) {
$this->_id = self::$autoIdPrefix . self::$counter++; $this->_id = static::$autoIdPrefix . static::$counter++;
} }
return $this->_id; return $this->_id;
......
...@@ -98,9 +98,9 @@ class GettextMessageSource extends MessageSource ...@@ -98,9 +98,9 @@ class GettextMessageSource extends MessageSource
{ {
$messageFile = Yii::getAlias($this->basePath) . '/' . $language . '/' . $this->catalog; $messageFile = Yii::getAlias($this->basePath) . '/' . $language . '/' . $this->catalog;
if ($this->useMoFile) { if ($this->useMoFile) {
$messageFile .= static::MO_FILE_EXT; $messageFile .= self::MO_FILE_EXT;
} else { } else {
$messageFile .= static::PO_FILE_EXT; $messageFile .= self::PO_FILE_EXT;
} }
return $messageFile; return $messageFile;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment