How do I create my own application component?

I’ve gone as far as creating a class and loading it in the config like this:




			'class' => 'application.components.myclass',



It works ok in that it’s initialized and one instance is created. But how do I access that instance? Yii::app()->myclass doesn’t work.


Nevermind, I’ve done it the right way. I can access properties (Yii::app()->myclass->var), but I can’t use it in callbacks.

That is, this doesn’t work:

$this->renderDynamic('Yii::app()->myclass->function', 'Hi');


$this->renderDynamic(array(Yii::app()->myclass, 'mymethod'), $param1, $param2, ...);