How to get the CWebApplication instance from Model class?

My objective is to use createUrl() function inside User model class. I notice createUrl() exists in CWebApplication and CController class.

How do I get instance of Cwebapplication or Controller in side a model class?

Is there a function like Yii::GetApplicationInstance?

Thank you very much!

Of course there is… if you just took a look at any extension or module there would be a good chance you would saw it ;)

Yii->app() -

Thanks a lot!