Swat/SwatInputControl.php
protected function getValidationMessage($id)
    {
        switch ($id) {
            case 'required':
                $text = $this->show_field_title_in_messages
                    ? Swat::_('%s is required.')
                    : Swat::_('This field is required.');

                break;
            case 'too-long':
                $text = $this->show_field_title_in_messages
                    ? Swat::_(
                        'The %%s field can be at most %s characters long.'
                    )
                    : Swat::_('This field can be at most %s characters long.');

                break;
            default:
                $text = $this->show_field_title_in_messages
                    ? Swat::_('There is a problem with the %s field.')
                    : Swat::_('There is a problem with this field.');

                break;
        }

        $message = new SwatMessage($text, 'error');
        return $message;
    }
protected function getValidationMessage($id)
    {
        switch ($id) {
            case 'required':
                $text = $this->show_field_title_in_messages
                    ? Swat::_('%s is required.')
                    : Swat::_('This field is required.');

                break;
            case 'too-long':
                $text = $this->show_field_title_in_messages
                    ? Swat::_(
                        'The %%s field can be at most %s characters long.'
                    )
                    : Swat::_('This field can be at most %s characters long.');

                break;
            default:
                $text = $this->show_field_title_in_messages
                    ? Swat::_('There is a problem with the %s field.')
                    : Swat::_('There is a problem with this field.');

                break;
        }

        $message = new SwatMessage($text, 'error');
        return $message;
    }
protected function getValidationMessage ( $ id ) { switch ( $ id ) { case 'required' : $ text = $ this -> show_field_title_in_messages ? Swat :: _ ( '%s is required.' ) : Swat :: _ ( 'This field is required.' ) ; break ; case 'too-long' : $ text = $ this -> show_field_title_in_messages ? Swat :: _ ( 'The %%s field can be at most %s characters long.' ) : Swat :: _ ( 'This field can be at most %s characters long.' ) ; break ; default : $ text = $ this -> show_field_title_in_messages ? Swat :: _ ( 'There is a problem with the %s field.' ) : Swat :: _ ( 'There is a problem with this field.' ) ; break ; } $ message = new SwatMessage ( $ text , 'error' ) ; return $ message ; }
Gets a validation message for this control

Can be used by sub-classes to change the validation messages.

@param string $id the string identifier of the validation message.

@return SwatMessage the validation message.
Gets a validation message for this control