filters() method is not executed on Controller


I created a new Yii Application using yiic and extended the class SiteController by a new action ‘password’. Finally I want to prevent not logged-in users to use this action.

Therefore I created the following bunch of code (just like the documentation says):

public function filters()


        return array(





    public function accessRules()


    	return array(







Unfortunately nothing happens. I tried to debug and found out that the ‘filters()’ method is never called during the application lifecycle.

Did I maybe forget to change a setting?

Thank you in advance!

you cannot setup accssControl on extended SiteConttroller, couse you extend action password??

you have to wrote

public function actionPassword(){

 //code in your SiteConttroller


couse you setup rule for /index.php?r=site/password link

or you have to setup rules in your password Conttroller, if you have it

I do have such a function actionPassword(). I understood that in a way that the function accessRules() inside a Controller is responsible for all actionXXX() functions inside that controller.

So what should I do to set rules for the actions of my "SiteController"?

all filter rules are ok but now i think

you have to set wich actions areallowed, try it :)

array('allow',  // allow all users to access 'index' and 'view' actions.




Doesnt work either :(

Don’t extend a controller, it doesn’t worth.

The code of the actions is standard and is only intended to be call to other objects (views or models).

If you want to write some reusable code, use models for it and do all customization you want in the controller class itself.