Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I see that you are passing your own Custom Validator. </p> <pre><code>-&gt;addValidator(new Validator_EmailValidator()) </code></pre> <p>You don't need to do that. Just use :</p> <pre><code> $validator = new Zend_Validate_EmailAddress() </code></pre> <p>Then just set that validator on the form item, and then set the messages against that validator.</p> <p>So</p> <pre><code> $emailId-&gt;setValidator( $validator ); </code></pre> <p>Now just set the Messages against the Validator, using the <code>setMessages</code> method.</p> <p>These are all of the potential messages that you can change:</p> <pre><code> const INVALID = 'emailAddressInvalid'; const INVALID_FORMAT = 'emailAddressInvalidFormat'; const INVALID_HOSTNAME = 'emailAddressInvalidHostname'; const INVALID_MX_RECORD = 'emailAddressInvalidMxRecord'; const INVALID_SEGMENT = 'emailAddressInvalidSegment'; const DOT_ATOM = 'emailAddressDotAtom'; const QUOTED_STRING = 'emailAddressQuotedString'; const INVALID_LOCAL_PART = 'emailAddressInvalidLocalPart'; const LENGTH_EXCEEDED = 'emailAddressLengthExceeded'; </code></pre> <hr> <h1>Message Defaults</h1> <pre><code>protected $_messageTemplates = array( self::INVALID =&gt; "Invalid type given. String expected", self::INVALID_FORMAT =&gt; "'%value%' is no valid email address in the basic format local-part@hostname", self::INVALID_HOSTNAME =&gt; "'%hostname%' is no valid hostname for email address '%value%'", self::INVALID_MX_RECORD =&gt; "'%hostname%' does not appear to have a valid MX record for the email address '%value%'", self::INVALID_SEGMENT =&gt; "'%hostname%' is not in a routable network segment. The email address '%value%' should not be resolved from public network", self::DOT_ATOM =&gt; "'%localPart%' can not be matched against dot-atom format", self::QUOTED_STRING =&gt; "'%localPart%' can not be matched against quoted-string format", self::INVALID_LOCAL_PART =&gt; "'%localPart%' is no valid local part for email address '%value%'", self::LENGTH_EXCEEDED =&gt; "'%value%' exceeds the allowed length", ); </code></pre> <p>Now just change the messages to whatever you want. You will need to update every message.</p> <pre><code> $validator-&gt;setMessages(array( Zend_Validate_EmailAddress::INVALID =&gt; "Invalid type given, value should be a string", Zend_Validate_EmailAddress::INVALID_FORMAT =&gt; "'%value%' is no valid email address in the basic format local-part@hostname", Zend_Validate_EmailAddress::INVALID_HOSTNAME =&gt; "'%hostname%' is no valid hostname for email address '%value%'", Zend_Validate_EmailAddress::INVALID_MX_RECORD =&gt; "'%hostname%' does not appear to have a valid MX record for the email address '%value%'", Zend_Validate_EmailAddress::INVALID_SEGMENT =&gt; "'%hostname%' is not in a routable network segment. The email address '%value%' should not be resolved from public network.", Zend_Validate_EmailAddress::DOT_ATOM =&gt; "'%localPart%' can not be matched against dot-atom format", Zend_Validate_EmailAddress::QUOTED_STRING =&gt; "'%localPart%' can not be matched against quoted-string format", Zend_Validate_EmailAddress::INVALID_LOCAL_PART =&gt; "'%localPart%' is no valid local part for email address '%value%'", Zend_Validate_EmailAddress::LENGTH_EXCEEDED =&gt; "'%value%' exceeds the allowed length", )); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload