I found out the if you are in the init function of a module and you call Yii::app()->getModule('moduleName')->property; the application will enter into an infinite loop.
for example:
class moduleName extends CWebModule
{
public property = 1;
public function init()
{
Yii::app()->getModule('moduleName')->property; // infinite loop;
}
}
So how can I find out the property value?
$this->property;
is not good, because I what tho be able to use the code in other parts of the application;
for example:
class Component{
public static function moduleProperty(){
return Yii::app()->getModule('moduleName')->property;
}
}
class moduleName extends CWebModule
{
public property = 1;
public function init()
{
Component::moduleProperty();
}
}

Help












