<?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 Framework 1.8 is upon us!</title>
	<atom:link href="http://www.rmauger.co.uk/2009/05/zend-framework-18-is-upon-us/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rmauger.co.uk/2009/05/zend-framework-18-is-upon-us/</link>
	<description>Randomness will get you everywhere.</description>
	<lastBuildDate>Mon, 30 Aug 2010 22:02:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Marcelo</title>
		<link>http://www.rmauger.co.uk/2009/05/zend-framework-18-is-upon-us/comment-page-1/#comment-230</link>
		<dc:creator>Marcelo</dc:creator>
		<pubDate>Wed, 22 Jul 2009 17:51:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.rmauger.co.uk/?p=69#comment-230</guid>
		<description>Great, i commented the wrong post... hahaha

stupid!

right one =&gt; Creating simple, extendible CRUD, using Zend Framework</description>
		<content:encoded><![CDATA[<p>Great, i commented the wrong post&#8230; hahaha</p>
<p>stupid!</p>
<p>right one =&gt; Creating simple, extendible CRUD, using Zend Framework</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcelo</title>
		<link>http://www.rmauger.co.uk/2009/05/zend-framework-18-is-upon-us/comment-page-1/#comment-229</link>
		<dc:creator>Marcelo</dc:creator>
		<pubDate>Wed, 22 Jul 2009 17:30:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.rmauger.co.uk/?p=69#comment-229</guid>
		<description>Btw, this post is awesome. Thank you for teaching good code!</description>
		<content:encoded><![CDATA[<p>Btw, this post is awesome. Thank you for teaching good code!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcelo</title>
		<link>http://www.rmauger.co.uk/2009/05/zend-framework-18-is-upon-us/comment-page-1/#comment-228</link>
		<dc:creator>Marcelo</dc:creator>
		<pubDate>Wed, 22 Jul 2009 17:27:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.rmauger.co.uk/?p=69#comment-228</guid>
		<description>I confess i didn&#039;t test it, but there is one thing i dint understand. How is the form populated when editing (nothing posted yet).

Shouldn&#039;t $users-&gt;getEditUserForm($post) also take $id as parameter just in case nothing was posted?

Sorry if i am talking BS, but i am very used to my massed spaghetti code pattern =/</description>
		<content:encoded><![CDATA[<p>I confess i didn&#8217;t test it, but there is one thing i dint understand. How is the form populated when editing (nothing posted yet).</p>
<p>Shouldn&#8217;t $users-&gt;getEditUserForm($post) also take $id as parameter just in case nothing was posted?</p>
<p>Sorry if i am talking BS, but i am very used to my massed spaghetti code pattern =/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://www.rmauger.co.uk/2009/05/zend-framework-18-is-upon-us/comment-page-1/#comment-190</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Tue, 02 Jun 2009 19:51:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.rmauger.co.uk/?p=69#comment-190</guid>
		<description>Kenrick, Thank you for the comments, and I&#039;m glad you like it :D

I have come across the same problem before, and I found that the way I dealt with this was to add the validator to the relevant element later than init(), as I usually have a process method in my forms which takes the post data, and a table row, and sets defaults, and determines if the post is empty, and then calls isValid, this was the ideal place for me to add this validator to the element, as I could get the ID from the row being passed to the method. and insert the validator just before calling isValid.
This doesn&#039;t really save any overhead, but it sure looks prettier than overloading the constructor.</description>
		<content:encoded><![CDATA[<p>Kenrick, Thank you for the comments, and I&#8217;m glad you like it <img src='http://www.rmauger.co.uk/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>I have come across the same problem before, and I found that the way I dealt with this was to add the validator to the relevant element later than init(), as I usually have a process method in my forms which takes the post data, and a table row, and sets defaults, and determines if the post is empty, and then calls isValid, this was the ideal place for me to add this validator to the element, as I could get the ID from the row being passed to the method. and insert the validator just before calling isValid.<br />
This doesn&#8217;t really save any overhead, but it sure looks prettier than overloading the constructor.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kenrick</title>
		<link>http://www.rmauger.co.uk/2009/05/zend-framework-18-is-upon-us/comment-page-1/#comment-189</link>
		<dc:creator>kenrick</dc:creator>
		<pubDate>Tue, 02 Jun 2009 19:08:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.rmauger.co.uk/?p=69#comment-189</guid>
		<description>hey that new validator is great, though for an idiot like me I had a gotcha when using it in conjunction with extending a Zend_Form. You can&#039;t just call it from inside of the init() function, and expect it to be able to get at the values being passed so you can validate against stuff. Uh lemme explain:

myForm extends Zend_Form
{
   function init()
   {
       $this-&gt;addElement(....array(
          &#039;validators&#039;=&gt;array(
               array(&#039;Db_NoRecordExists&#039;,
                      false,
                      array(&#039;users&#039;,
                            &#039;email&#039;,
                            array(
                                  &#039;field&#039;=&gt;&#039;id&#039;,
                                  &#039;value&#039;=&gt;$this-&gt;_userId  // this has to come from someplace!
                                                                                // you can just do a $this-&gt;id-&gt;getValue(), since 
                                                                               // this is inside the init() function...
                                  )
                            ))
           ) 
       ))
   }
}

well I just had to modify the __construct method of myForm to accept some kind of value that could be used in the init() function for check records in the database. Maybe this is totally obvious to everyone else, but I&#039;m working on no sleep[ and 6 cups of coffee right now...

Thanks again for the contribution.</description>
		<content:encoded><![CDATA[<p>hey that new validator is great, though for an idiot like me I had a gotcha when using it in conjunction with extending a Zend_Form. You can&#8217;t just call it from inside of the init() function, and expect it to be able to get at the values being passed so you can validate against stuff. Uh lemme explain:</p>
<p>myForm extends Zend_Form<br />
{<br />
   function init()<br />
   {<br />
       $this-&gt;addElement(&#8230;.array(<br />
          &#8216;validators&#8217;=&gt;array(<br />
               array(&#8216;Db_NoRecordExists&#8217;,<br />
                      false,<br />
                      array(&#8216;users&#8217;,<br />
                            &#8216;email&#8217;,<br />
                            array(<br />
                                  &#8216;field&#8217;=&gt;&#8217;id&#8217;,<br />
                                  &#8216;value&#8217;=&gt;$this-&gt;_userId  // this has to come from someplace!<br />
                                                                                // you can just do a $this-&gt;id-&gt;getValue(), since<br />
                                                                               // this is inside the init() function&#8230;<br />
                                  )<br />
                            ))<br />
           )<br />
       ))<br />
   }<br />
}</p>
<p>well I just had to modify the __construct method of myForm to accept some kind of value that could be used in the init() function for check records in the database. Maybe this is totally obvious to everyone else, but I&#8217;m working on no sleep[ and 6 cups of coffee right now&#8230;</p>
<p>Thanks again for the contribution.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
