How to customize the error message of a validation rule

Comparing #2 with #3

Revision #3 was created by wei wei on Feb 4, 2009, 10:59:29 PM.

Reduce code horizontal length

Content

[...]
class Post extends CActiveRecord
{
public function rules()
{
return array(
array('title, content', 'required',

 
     
'message'=>'Please enter a value for {attribute}.'),
// ... other rules
);
}
}
```
[...]