How to add a custom error message in sfValidator, the form is
$this->setWidgets(array(
'name' =>new sfWidgetFormInput(),
'country' =>new sfWidgetFormChoice(array('choices' => CountriesPeer::getAllCountries())),
));
the validators
$this->setValidators(array(
'name' =>new sfValidatorString(array('required'=>true)),
'country' =>new sfValidatorChoice(array('choices' => array_keys(CountriesPeer::getAllCountries()))),
));
instead of required, or invalid message i want a custom message(like 'name is required' 'please select a country'). I know that we can set custom error message while rendering the form, but can we set it in form validators??