yii错误信息定制

错误信息定制:
class Post extends CActiveRecord
{
    public function rules()
    {
        return array(
            array('title, content', 'required',
                  'message'=>'Please enter a value for {attribute}.'),
            // ... other rules
        );
    }
}
字符串过长:
class Post extends CActiveRecord
{
    public function rules()
    {
        return array(
     array('deliveryNo','length', 'max'=>'5','tooLong'=>'不能超过5个字符!'),
          // ... other rules
        );
    }
}
posted on 2011-06-02 23:03  DavidYanXW  阅读(223)  评论(0)    收藏  举报