controller name

What is the way to get the controller name from class UserIdentity?


Yii::app()->controller->id

works everywhere.

I have the code

class UserIdentity extends CUserIdentity {…


public function authenticateByCookie() {...

  Yii::app()->myutilitie->afterAuth($this->_id,'login'.Yii::app()->controller->id);

....

and there is the error Trying to get property of non-object

What is wrong?

What is myutilitie? Have you configured that as application component? Otherwhise you can’t access this object.

It is




'components'=>array(...

'myutilitie'=>array(

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

),


class Utilitie extends CComponent {...

[Edit]This code is at authenticate() of this class and at controllers and it works.

This function runs when user has select the remember me function and he did not do logout and he comes again at the site,is something with that?