Skip to content

Commit

Permalink
fix getModuleName
Browse files Browse the repository at this point in the history
  • Loading branch information
noumo committed Feb 11, 2016
1 parent c21a33b commit 3ff4d3c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions components/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Module extends \yii\base\Module
/** @var @todo */
public $i18n;

public static $NAME;
private static $NAMES = [];

/**
* Configuration for installation
Expand All @@ -41,10 +41,11 @@ public function init()

public static function getSelfName()
{
if(!static::$NAME){
static::$NAME = static::getModuleName(static::className());
$className = static::className();
if(!isset(self::$NAMES[$className])){
self::$NAMES[$className] = self::getModuleName($className);
}
return static::$NAME;
return self::$NAMES[$className];
}

/**
Expand Down

0 comments on commit 3ff4d3c

Please sign in to comment.