<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Yet another data validation approach</title>
	<atom:link href="http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Tue, 29 Sep 2009 06:55:31 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Xadio</title>
		<link>http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-1071</link>
		<dc:creator>Xadio</dc:creator>
		<pubDate>Sun, 23 Jul 2006 09:24:21 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-1071</guid>
		<description>I modified Cakebaker&#039;s Advanced Validation so that I could reduce the number of validating methods and increase reuse through the allowance of parameters. (ie one unique method that checks unique of username and email dynamically)  You can find it on the CakePHP Wiki.  http://wiki.cakephp.org/tutorials:advanced_validation:advance_validation_with_parameters#advanced_validation_with_parameters</description>
		<content:encoded><![CDATA[<p>I modified Cakebaker&#8217;s Advanced Validation so that I could reduce the number of validating methods and increase reuse through the allowance of parameters. (ie one unique method that checks unique of username and email dynamically)  You can find it on the CakePHP Wiki.  <a href="http://wiki.cakephp.org/tutorials:advanced_validation:advance_validation_with_parameters#advanced_validation_with_parameters" rel="nofollow">http://wiki.cakephp.org/tutorials:advanced_validation:advance_validation_with_parameters#advanced_validation_with_parameters</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: binoy</title>
		<link>http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-886</link>
		<dc:creator>binoy</dc:creator>
		<pubDate>Tue, 04 Jul 2006 15:59:16 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-886</guid>
		<description>Hi,
I am using Cake 1.0.1.2708 and I am using this advanced validation technique.  It is working fine.

But I want to send some parameters to the custom function. What I need to change in the code. Any help ?</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I am using Cake 1.0.1.2708 and I am using this advanced validation technique.  It is working fine.</p>
<p>But I want to send some parameters to the custom function. What I need to change in the code. Any help ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-818</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Wed, 28 Jun 2006 07:57:47 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-818</guid>
		<description>@olegs: I have added this functionality to fix the following bug: https://trac.cakephp.org/ticket/781</description>
		<content:encoded><![CDATA[<p>@olegs: I have added this functionality to fix the following bug: <a href="https://trac.cakephp.org/ticket/781" rel="nofollow">https://trac.cakephp.org/ticket/781</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: olegs</title>
		<link>http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-793</link>
		<dc:creator>olegs</dc:creator>
		<pubDate>Sat, 24 Jun 2006 21:45:36 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-793</guid>
		<description>Hello,
Why do you need to merge old and new data ? 

    if (isset($this-&gt;data))
    {
        $data = array_merge($data, $this-&gt;data);
    }
(I&#039;m referring here to the function for Cake&gt;1.0.1.2708. In cake original invalidFields() function there is no such behaviour).</description>
		<content:encoded><![CDATA[<p>Hello,<br />
Why do you need to merge old and new data ? </p>
<p>    if (isset($this-&gt;data))<br />
    {<br />
        $data = array_merge($data, $this-&gt;data);<br />
    }<br />
(I&#8217;m referring here to the function for Cake&gt;1.0.1.2708. In cake original invalidFields() function there is no such behaviour).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cake baker &#187; Upgrading to version 1.0 III</title>
		<link>http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-450</link>
		<dc:creator>cake baker &#187; Upgrading to version 1.0 III</dc:creator>
		<pubDate>Thu, 18 May 2006 09:36:14 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-450</guid>
		<description>[...] Update (2006-05-06): It transpired that the bug was in the advanced validation approach I use, and not in Model-&gt;save(). [...]</description>
		<content:encoded><![CDATA[<p>[...] Update (2006-05-06): It transpired that the bug was in the advanced validation approach I use, and not in Model-&gt;save(). [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-363</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Sun, 07 May 2006 10:11:07 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-363</guid>
		<description>@Brandon Pearce: Interesting idea. I am not aware of such a helper, so you have to write it yourself. I think it is not always possible to get the label text from the model (e.g. if the language of the user interface is not english), so this parameter should be at least optional.

I think the reason why there is no generatePasswordDiv() function is that it is not possible to automatically create such fields with scaffolding. But you can open a ticket with such a feature request.</description>
		<content:encoded><![CDATA[<p>@Brandon Pearce: Interesting idea. I am not aware of such a helper, so you have to write it yourself. I think it is not always possible to get the label text from the model (e.g. if the language of the user interface is not english), so this parameter should be at least optional.</p>
<p>I think the reason why there is no generatePasswordDiv() function is that it is not possible to automatically create such fields with scaffolding. But you can open a ticket with such a feature request.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon Pearce</title>
		<link>http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-359</link>
		<dc:creator>Brandon Pearce</dc:creator>
		<pubDate>Sat, 06 May 2006 22:48:08 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-359</guid>
		<description>I think this is the greatest thing! Makes form validation so much easier. The only thing I see lacking in Cake now in regards to validation is the Form Helper.  Wouldn&#039;t it be nice if the Form Helper could tell by looking at the model whether a field is required, and what the error message should be, rather than me having to pass in those values?  It would be great to get a form looking like this:
http://kalsey.com/simplified/form_errors/index.html

So, instead of this:
generateInputDiv(&#039;User/first_name&#039;, &#039;First Name&#039;, true, &#039;Please enter your first name&#039;)?&gt;

Just take all the validation from the model, so all you have to type is:
generateInputDiv(&#039;User/first_name&#039;)?&gt;

And it will generate the appropriate error messages, as well as the label (or prompt - just humanize first_name). Wouldn&#039;t that save a lot of typing - and there&#039;s no reason to type the validation messages in the model AND the view.
(Also, why is there no generatePasswordDiv() function in the form helper?)

Is this already done somewhere and currently possible with Cake or would someone have to write another helper for this? Any thoughts?</description>
		<content:encoded><![CDATA[<p>I think this is the greatest thing! Makes form validation so much easier. The only thing I see lacking in Cake now in regards to validation is the Form Helper.  Wouldn&#8217;t it be nice if the Form Helper could tell by looking at the model whether a field is required, and what the error message should be, rather than me having to pass in those values?  It would be great to get a form looking like this:<br />
<a href="http://kalsey.com/simplified/form_errors/index.html" rel="nofollow">http://kalsey.com/simplified/form_errors/index.html</a></p>
<p>So, instead of this:<br />
generateInputDiv(&#8216;User/first_name&#8217;, &#8216;First Name&#8217;, true, &#8216;Please enter your first name&#8217;)?&gt;</p>
<p>Just take all the validation from the model, so all you have to type is:<br />
generateInputDiv(&#8216;User/first_name&#8217;)?&gt;</p>
<p>And it will generate the appropriate error messages, as well as the label (or prompt &#8211; just humanize first_name). Wouldn&#8217;t that save a lot of typing &#8211; and there&#8217;s no reason to type the validation messages in the model AND the view.<br />
(Also, why is there no generatePasswordDiv() function in the form helper?)</p>
<p>Is this already done somewhere and currently possible with Cake or would someone have to write another helper for this? Any thoughts?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-355</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Sat, 06 May 2006 08:49:06 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-355</guid>
		<description>@Zachary Naiman: Thanks for your comment. I had the same problem, but &quot;solved&quot; it in a different way. I thought it was a bug in Model-&gt;save() and fixed that &quot;bug&quot; ;-)  I applied a bugfix and will modify this post and the wiki entry in a moment. 

Thanks, and happy baking :)</description>
		<content:encoded><![CDATA[<p>@Zachary Naiman: Thanks for your comment. I had the same problem, but &#8220;solved&#8221; it in a different way. I thought it was a bug in Model-&gt;save() and fixed that &#8220;bug&#8221; ;-)  I applied a bugfix and will modify this post and the wiki entry in a moment. </p>
<p>Thanks, and happy baking :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zachary Naiman</title>
		<link>http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-350</link>
		<dc:creator>Zachary Naiman</dc:creator>
		<pubDate>Fri, 05 May 2006 16:43:38 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-350</guid>
		<description>My colleagues and I are new to CAKE, and after a couple weeks of evaluating it versus other products (mainly symphony), we decided to use CAKE for all future php development in our office. Shortly after we tried to implement this validation method as CAKE&#039;s current validation functions don&#039;t allow for creating multiple validation rules. As with chris, we followed the tutorial, but invalid data was still being saved to the database and no messages were reported.

What we&#039;ve figured out so far is that the very first &quot;if&quot; statement in the AppModel &quot;invalidFields&quot; function was being interpreted as true because  $this-&gt;validationErrors is an (enpty) array. So our quick way around this, which seems to make things work OK, is to either change the condition on that first if statement (put an exclamation point before is_array($this-&gt;validationErrors)), or (what seems like a better idea) to put this code before the if statment: if (empty($this-&gt;validationErrors)){unset($this-&gt;validationErrors);$this-&gt;validationErrors=&quot;&quot;;}

Since we&#039;re really new to CAKE, we&#039;re not sure what the implications of this strategy will be, but we&#039;d love some feedback.

Also, thanks to cakebaker and the whole CAKE community.</description>
		<content:encoded><![CDATA[<p>My colleagues and I are new to CAKE, and after a couple weeks of evaluating it versus other products (mainly symphony), we decided to use CAKE for all future php development in our office. Shortly after we tried to implement this validation method as CAKE&#8217;s current validation functions don&#8217;t allow for creating multiple validation rules. As with chris, we followed the tutorial, but invalid data was still being saved to the database and no messages were reported.</p>
<p>What we&#8217;ve figured out so far is that the very first &#8220;if&#8221; statement in the AppModel &#8220;invalidFields&#8221; function was being interpreted as true because  $this-&gt;validationErrors is an (enpty) array. So our quick way around this, which seems to make things work OK, is to either change the condition on that first if statement (put an exclamation point before is_array($this-&gt;validationErrors)), or (what seems like a better idea) to put this code before the if statment: if (empty($this-&gt;validationErrors)){unset($this-&gt;validationErrors);$this-&gt;validationErrors=&#8221;";}</p>
<p>Since we&#8217;re really new to CAKE, we&#8217;re not sure what the implications of this strategy will be, but we&#8217;d love some feedback.</p>
<p>Also, thanks to cakebaker and the whole CAKE community.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kain</title>
		<link>http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-238</link>
		<dc:creator>kain</dc:creator>
		<pubDate>Thu, 20 Apr 2006 03:43:10 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.wordpress.com/2006/02/06/yet-another-data-validation-approach/#comment-238</guid>
		<description>I think there is a problem if we apply this method to a Model/field like User/name.. data cannot be validated.

&#039;name&#039;        =&gt; array(array(VALID_NOT_EMPTY))

I&#039;m using tagerrormsg way

works with 
var $validate = array(&#039;name&#039; =&gt; VALID_NOT_EMPTY);
as normal but we cannot use this string with this method.</description>
		<content:encoded><![CDATA[<p>I think there is a problem if we apply this method to a Model/field like User/name.. data cannot be validated.</p>
<p>&#8216;name&#8217;        =&gt; array(array(VALID_NOT_EMPTY))</p>
<p>I&#8217;m using tagerrormsg way</p>
<p>works with<br />
var $validate = array(&#8216;name&#8217; =&gt; VALID_NOT_EMPTY);<br />
as normal but we cannot use this string with this method.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
