Accessing Static method of an Extension

Hi all,

I am writing a small extension within my app, and I was wondering if we can define a static method in the class that represents the extension, and call it later on, without instanciating the complete extension (no call to the init() method).

For example:


But it doesn’t work (basic syntax error).

Though if I do:


The method is called, but the complete extension is also instanciated (init called first).

The same applies for constants:

const YII = 'Hi';

How can I access such variable?

I don’t know if I am clear enough…

Thanks in advance,


OK I figured out:

$myextension = Yii::app()->myextension;


echo $myextension::YII;