<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Zend_Filter_Input  / Zend_Validate Messages</title>
	<atom:link href="http://akrabat.com/php/zend_filter_input-zend_validate-messages/feed/" rel="self" type="application/rss+xml" />
	<link>http://akrabat.com/php/zend_filter_input-zend_validate-messages/</link>
	<description>Developing PHP software in the Real World, by Rob Allen</description>
	<lastBuildDate>Thu, 11 Mar 2010 20:06:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Paul</title>
		<link>http://akrabat.com/php/zend_filter_input-zend_validate-messages/#comment-20398</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Sun, 09 Mar 2008 01:40:58 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/2007/09/14/zend_filter_input-zend_validate-messages/#comment-20398</guid>
		<description>Oh I should have mentoned in the last post, you can still use define messages for Zend_Validate_Alnum::STRING_EMPTY in the validators array you send Zend_Filter_Input, it just means a lot of extra lines on complex forms until they fix the bug.
&lt;pre&gt;
$validators = array(
    &#039;month&#039; =&gt; array(
        &#039;Alnum&#039;,        
        array(&#039;Between&#039;, array(1, 12)),
            &#039;messages&#039; =&gt; array(            
                array( Zend_Validate_Alnum::STRING_EMPTY =&gt; &quot;A month value is required&quot;, 
                    Zend_Validate_Alnum::NOT_ALNUM =&gt; &quot;Month must only consist of numbers or letters&quot; ),            
                &#039;Month must be between 1 and 12&#039;        
            )
        )
    )
);
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Oh I should have mentoned in the last post, you can still use define messages for Zend_Validate_Alnum::STRING_EMPTY in the validators array you send Zend_Filter_Input, it just means a lot of extra lines on complex forms until they fix the bug.</p>
<pre>
$validators = array(
    'month' =&gt; array(
        'Alnum',
        array('Between', array(1, 12)),
            'messages' =&gt; array(
                array( Zend_Validate_Alnum::STRING_EMPTY =&gt; "A month value is required",
                    Zend_Validate_Alnum::NOT_ALNUM =&gt; "Month must only consist of numbers or letters" ),
                'Month must be between 1 and 12'
            )
        )
    )
);
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://akrabat.com/php/zend_filter_input-zend_validate-messages/#comment-20397</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Sun, 09 Mar 2008 01:38:57 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/2007/09/14/zend_filter_input-zend_validate-messages/#comment-20397</guid>
		<description>Theres a bug in Zend_Input_Fitler at the moment, it kind of drove me nuts for a few hours.

Validators with stringEmpty validation messages cannot have those messages overwritten by the ones you define in options.

So even if you define a custom &#039;notEmptyMessage&#039; in the options, the  alnum validator will still send back its default notEmpty message.

See http://framework.zend.com/issues/browse/ZF-1912</description>
		<content:encoded><![CDATA[<p>Theres a bug in Zend_Input_Fitler at the moment, it kind of drove me nuts for a few hours.</p>
<p>Validators with stringEmpty validation messages cannot have those messages overwritten by the ones you define in options.</p>
<p>So even if you define a custom 'notEmptyMessage' in the options, the  alnum validator will still send back its default notEmpty message.</p>
<p>See <a href="http://framework.zend.com/issues/browse/ZF-1912" rel="nofollow">http://framework.zend.com/issues/browse/ZF-1912</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob...</title>
		<link>http://akrabat.com/php/zend_filter_input-zend_validate-messages/#comment-14036</link>
		<dc:creator>Rob...</dc:creator>
		<pubDate>Thu, 20 Sep 2007 05:08:29 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/2007/09/14/zend_filter_input-zend_validate-messages/#comment-14036</guid>
		<description>Cheers Steve!

Regards,

Rob...</description>
		<content:encoded><![CDATA[<p>Cheers Steve!</p>
<p>Regards,</p>
<p>Rob...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steve goodman</title>
		<link>http://akrabat.com/php/zend_filter_input-zend_validate-messages/#comment-14029</link>
		<dc:creator>steve goodman</dc:creator>
		<pubDate>Wed, 19 Sep 2007 20:38:19 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/2007/09/14/zend_filter_input-zend_validate-messages/#comment-14029</guid>
		<description>I&#039;m not sure if this is mentioned in the official docs, but if you aren&#039;t interested in the particular type of validation error thrown by a validator in a Zend_Input_Filter chain, you don&#039;t have to assign your custom message to a constant. Rather, you can just assign a single message to the validator. 

For instance, the two messages for Zend_Validate_Between are pretty similar, and you might not want to have to assign a message to both constants. In this case, the following code would allow you to specify a custom message for both errors NOT_BETWEEN and NOT_BETWEEN_STRICT:

$validators = array(			
  &#039;salary&#039; =&gt; array(
    array(&#039;Between&#039;, 10000, 20000),
    &#039;messages&#039; =&gt; array( 
	&#039;Salary must be between $10,000 and $20,000&#039;)));</description>
		<content:encoded><![CDATA[<p>I'm not sure if this is mentioned in the official docs, but if you aren't interested in the particular type of validation error thrown by a validator in a Zend_Input_Filter chain, you don't have to assign your custom message to a constant. Rather, you can just assign a single message to the validator. </p>
<p>For instance, the two messages for Zend_Validate_Between are pretty similar, and you might not want to have to assign a message to both constants. In this case, the following code would allow you to specify a custom message for both errors NOT_BETWEEN and NOT_BETWEEN_STRICT:</p>
<p>$validators = array(<br />
  'salary' =&gt; array(<br />
    array('Between', 10000, 20000),<br />
    'messages' =&gt; array(<br />
	'Salary must be between $10,000 and $20,000')));</p>
]]></content:encoded>
	</item>
</channel>
</rss>
