How To Customize The Error Message Of A Validation Rule

How to customize the error message of a validation rule. and also how we add validation rules for dynamic field id and dynamic class. ?

  1. just add array key ‘message’ => ‘your text’ to the validation rule.

you can ref this link for creating custom validation rule in model.

thanx for the quick reply. :)