Best way to display custom messages

How could you display validation error messages in forms when there is no validator and you don’t want to write one, for example you dont want to write a generic unique validator for multi columns, but display the message in a way like when you would have used the validator?

Maybe Flash messages will help you. Take a look at this:

http://www.yiiframework.com/doc/api/1.1/CWebUser#setFlash-detail

You can add an error to the module:

$model->addError(‘fieldName’, ‘Custom message’);

Another way (the one I use the most) is to create a try catch scenario. When my custom validation fails, I throw an Exception or CException and on catch I render a custom error view.