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();
}
}
Does that occur if you try it set config values for your module? I’ve got some modules that I add in submodules to and things work fine. The syntax is like this:
$this->modules = array(
... config information for other modules here
);
I know that code works, as it’s running in production on a system that launched yesterday.
Let me know. Also, you don’t happen to be overriding your __get / __set methods, so you?