'deniedCallback' problem


I try to follow this post:


So I have the code as follows in my controller:

public function filters(){

   return array('accessControl');


public function accessRules(){

   return array(



         'deniedCallback' => 'redirectToHome',






public function redirectToHome(){



Unfortunately - the following message pops-up:

Error: 500

call_user_func() expects parameter 1 to be a valid callback, function 'redirectToHome' not found or invalid function name

Any idea why my callback is not recognized?

Of course I use recent 1.1.12 version of Yii framework.

Thanks ahead!

Yeap - I’ve got it:

This is the right way:

‘deniedCallback’ => array($this, ‘redirectToHome’),