CTimestampBehavior problem

Hi everybody,

I follow the instruction for CTimestampBehavior and I get an error like :

« PhFabricantController.onAfterConstruct » not defined.

I just add this to my controller.

public function behaviors() {


    return array(


        'CTimestampBehavior' => array(


            'class' => 'zii.behaviors.CTimestampBehavior',


        )


    );


}    

}

Note : My controller derive from CControler

Any clue what I missed ?

Please read documentation carefully:

My model is defined like this :

class PhFabricant extends BasePhFabricant

and

abstract class BasePhFabricant extends I18nActiveRecord

and

class I18nActiveRecord extends CActiveRecord

I must also say that afterConstruct event is overided in the I18nActiveRecord class.

How can I do the same as CTimestampBehavior with this ?

That’s not a problem, if done properly.

Just attach behavior to PhFabricant model (rather than controller) as described in the documentation. It should work.

Thank you, that worked fine. Have a nice day.