class Model extends CActiveRecord
{
...
public function rules()
{
return array(
array("myAttribute", "validateMyAttribute"),
);
}
public function behaviors()
{
return array(
'validateMyAttribute' => array(
'class' => 'MyBehavior'
),
);
}
class MyBehavior extends CBehavior
{
public function validateMyAttribute()
{
$this->owner->addError("myAttribute", "BOOM!");
}
...
[color="#FF0000"][font="Arial Black"]PHP warning[/font][/color]
include(validateMyAttribute.php): failed to open stream: No such file or directory
[color="#006400"]Why the model cannot see my behavior function?[/color]
I work with Yii 1; thank you for your time