<?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: Multi-record Forms</title>
	<atom:link href="http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/feed/" rel="self" type="application/rss+xml" />
	<link>http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/</link>
	<description>My forays into the Kitchen</description>
	<lastBuildDate>Wed, 04 Nov 2009 22:02:31 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: mihai</title>
		<link>http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-2489</link>
		<dc:creator>mihai</dc:creator>
		<pubDate>Wed, 09 Sep 2009 09:19:31 +0000</pubDate>
		<guid isPermaLink="false">http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-2489</guid>
		<description>Thanks! I looked for hours for a way to fix this. Big and complex form with an array of smaller forms at the bottom (with some javascript for adding and removing items). Now it works fine :)</description>
		<content:encoded><![CDATA[<p>Thanks! I looked for hours for a way to fix this. Big and complex form with an array of smaller forms at the bottom (with some javascript for adding and removing items). Now it works fine <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guillermo Mansilla</title>
		<link>http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-2349</link>
		<dc:creator>Guillermo Mansilla</dc:creator>
		<pubDate>Thu, 21 May 2009 16:15:15 +0000</pubDate>
		<guid isPermaLink="false">http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-2349</guid>
		<description>Why not just to use Model::saveAll( )?</description>
		<content:encoded><![CDATA[<p>Why not just to use Model::saveAll( )?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scuba Steve</title>
		<link>http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-2218</link>
		<dc:creator>Scuba Steve</dc:creator>
		<pubDate>Wed, 18 Feb 2009 16:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-2218</guid>
		<description>Cheers for the code. Exactly what I needed. Working perfectly now...</description>
		<content:encoded><![CDATA[<p>Cheers for the code. Exactly what I needed. Working perfectly now&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dfg</title>
		<link>http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-2044</link>
		<dc:creator>dfg</dc:creator>
		<pubDate>Sun, 26 Oct 2008 08:35:46 +0000</pubDate>
		<guid isPermaLink="false">http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-2044</guid>
		<description>Man,

why is this not working....

are you supposed to have a button?
or maybe tables even......

help out the noobs here bro. you DID tag it as a noob tutorial</description>
		<content:encoded><![CDATA[<p>Man,</p>
<p>why is this not working&#8230;.</p>
<p>are you supposed to have a button?<br />
or maybe tables even&#8230;&#8230;</p>
<p>help out the noobs here bro. you DID tag it as a noob tutorial</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Catalin</title>
		<link>http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-2016</link>
		<dc:creator>Catalin</dc:creator>
		<pubDate>Sat, 09 Aug 2008 08:43:27 +0000</pubDate>
		<guid isPermaLink="false">http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-2016</guid>
		<description>Hey there Geoff

I did this a different way, but i reached your article looking for something else:a way to use transactions when doing this. If you do the inserts in a for loop, and one insert raises an error, or something stops the script from running, won&#039;t there be inconsistent data? 

With multi-record fields i think we should always try to use transactions... but HOW? Especially in PHP4 which doesn&#039;t accept try/except instructions...

This may not be a question 100% in the direction of the theme here discusses, but it&#039;s my big question of the moment

Thanks

Cata</description>
		<content:encoded><![CDATA[<p>Hey there Geoff</p>
<p>I did this a different way, but i reached your article looking for something else:a way to use transactions when doing this. If you do the inserts in a for loop, and one insert raises an error, or something stops the script from running, won&#8217;t there be inconsistent data? </p>
<p>With multi-record fields i think we should always try to use transactions&#8230; but HOW? Especially in PHP4 which doesn&#8217;t accept try/except instructions&#8230;</p>
<p>This may not be a question 100% in the direction of the theme here discusses, but it&#8217;s my big question of the moment</p>
<p>Thanks</p>
<p>Cata</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tamerlan</title>
		<link>http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-1947</link>
		<dc:creator>Tamerlan</dc:creator>
		<pubDate>Tue, 29 Apr 2008 15:06:53 +0000</pubDate>
		<guid isPermaLink="false">http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-1947</guid>
		<description>Hi! 
 im a newbie at cakephp, can you explain a which models you use?
look like you have a 3 tables? im right?
sorry  for my english, its not my native language.</description>
		<content:encoded><![CDATA[<p>Hi!<br />
 im a newbie at cakephp, can you explain a which models you use?<br />
look like you have a 3 tables? im right?<br />
sorry  for my english, its not my native language.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anton - links for 2008-03-08 at antonolsen.com</title>
		<link>http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-1927</link>
		<dc:creator>anton - links for 2008-03-08 at antonolsen.com</dc:creator>
		<pubDate>Sat, 08 Mar 2008 14:20:18 +0000</pubDate>
		<guid isPermaLink="false">http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-1927</guid>
		<description>[...] Multi-record Forms « Another Cake Baker Handling multi-record forms in cake.  (tags: cakephp multirecord forms) [...]</description>
		<content:encoded><![CDATA[<p>[...] Multi-record Forms « Another Cake Baker Handling multi-record forms in cake.  (tags: cakephp multirecord forms) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Boyer</title>
		<link>http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-1915</link>
		<dc:creator>David Boyer</dc:creator>
		<pubDate>Mon, 18 Feb 2008 13:21:14 +0000</pubDate>
		<guid isPermaLink="false">http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-1915</guid>
		<description>Great article, certainly pointed me in the right direction with things :)

I also ran into the problem of validation errors not being displayed.  Went digging and found that someone has already submitted a patch, which works pretty well.  It&#039;s a small edit of the helper.php file to include the modelId

https://trac.cakephp.org/ticket/4076

When patched, errors get displayed.</description>
		<content:encoded><![CDATA[<p>Great article, certainly pointed me in the right direction with things <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I also ran into the problem of validation errors not being displayed.  Went digging and found that someone has already submitted a patch, which works pretty well.  It&#8217;s a small edit of the helper.php file to include the modelId</p>
<p><a href="https://trac.cakephp.org/ticket/4076" rel="nofollow">https://trac.cakephp.org/ticket/4076</a></p>
<p>When patched, errors get displayed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff</title>
		<link>http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-325</link>
		<dc:creator>Geoff</dc:creator>
		<pubDate>Wed, 05 Sep 2007 04:08:16 +0000</pubDate>
		<guid isPermaLink="false">http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-325</guid>
		<description>Prond,

I have not had much to do with ClassRegistry, but that is a relly neat feature and is cleaner and more elegant than my solution.

I assuming that when using dynamic ajax forms you would have to update the form submission url so that the count is correct.

Thanks for the tip and I&#039;ll try it out sometime soon.

Geoff</description>
		<content:encoded><![CDATA[<p>Prond,</p>
<p>I have not had much to do with ClassRegistry, but that is a relly neat feature and is cleaner and more elegant than my solution.</p>
<p>I assuming that when using dynamic ajax forms you would have to update the form submission url so that the count is correct.</p>
<p>Thanks for the tip and I&#8217;ll try it out sometime soon.</p>
<p>Geoff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: prond</title>
		<link>http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-323</link>
		<dc:creator>prond</dc:creator>
		<pubDate>Tue, 04 Sep 2007 11:03:13 +0000</pubDate>
		<guid isPermaLink="false">http://lemoncake.wordpress.com/2007/08/06/multi-record-forms/#comment-323</guid>
		<description>I think it all can be done much simpler (== less work):

controllers/pages_controller.php :
function addMany($count = 2) {
    for ($i=1;$i&lt;=$count;$i++) {
        $modelName = &quot;Page{$i}&quot;;
        $this-&gt;{$modelName} = &amp; new Page;
        $this-&gt;{$modelName}-&gt;useTable = &quot;page&quot;;
        $this-&gt;{$modelName}-&gt;name = $modelName;
        ClassRegistry::addObject(&quot;Page{$i}&quot;,$this-&gt;{$modelName});
    }
 
    if (!empty($this-&gt;data)) {
        for ($i=1;$i&lt;=$count;$i++) {
            $modelName = &quot;Page{$i}&quot;;
            $this-&gt;{$modelName}-&gt;create($this-&gt;data);
            $this-&gt;{$modelName}-&gt;save();
        }
    }
 
    $languages = $this-&gt;Page-&gt;Language-&gt;generateList();
 
    $this-&gt;set(&#039;count&#039;,$count);
    $this-&gt;set(compact(&#039;languages&#039;));
}

views/pages/add_many.php :

    
    
    &lt;?php for ($i=1;$i
        
             
        input(&quot;Page{$i}.language_id&quot;);
            echo $form-&gt;input(&quot;Page{$i}.name&quot;);
            echo $form-&gt;input(&quot;Page{$i}.urn&quot;);
            echo $form-&gt;input(&quot;Page{$i}.description&quot;);
            echo $form-&gt;input(&quot;Page{$i}.keywords&quot;);
            echo $form-&gt;input(&quot;Page{$i}.published_from&quot;);
            echo $form-&gt;input(&quot;Page{$i}.published_to&quot;);
            echo $form-&gt;input(&quot;Page{$i}.published&quot;);
            echo $form-&gt;input(&quot;Page{$i}.contents&quot;);
        ?&gt;
        
    
    end(&#039;Submit&#039;);?&gt;
    
    
        
            link(__(&#039;List&#039;, true).&#039; &#039;.__(&#039;Pages&#039;, true), array(&#039;action&#039;=&gt;&#039;index&#039;));?&gt;
            link(__(&#039;List&#039;, true).&#039; &#039;.__(&#039;Languages&#039;, true), array(&#039;controller&#039;=&gt; &#039;languages&#039;, &#039;action&#039;=&gt;&#039;index&#039;)); ?&gt; 
            link(__(&#039;New&#039;, true).&#039; &#039;.__(&#039;Language&#039;, true), array(&#039;controller&#039;=&gt; &#039;languages&#039;, &#039;action&#039;=&gt;&#039;add&#039;)); ?&gt; 
        
    </description>
		<content:encoded><![CDATA[<p>I think it all can be done much simpler (== less work):</p>
<p>controllers/pages_controller.php :<br />
function addMany($count = 2) {<br />
    for ($i=1;$i&lt;=$count;$i++) {<br />
        $modelName = &#8220;Page{$i}&#8221;;<br />
        $this-&gt;{$modelName} = &amp; new Page;<br />
        $this-&gt;{$modelName}-&gt;useTable = &#8220;page&#8221;;<br />
        $this-&gt;{$modelName}-&gt;name = $modelName;<br />
        ClassRegistry::addObject(&#8220;Page{$i}&#8221;,$this-&gt;{$modelName});<br />
    }</p>
<p>    if (!empty($this-&gt;data)) {<br />
        for ($i=1;$i&lt;=$count;$i++) {<br />
            $modelName = &#8220;Page{$i}&#8221;;<br />
            $this-&gt;{$modelName}-&gt;create($this-&gt;data);<br />
            $this-&gt;{$modelName}-&gt;save();<br />
        }<br />
    }</p>
<p>    $languages = $this-&gt;Page-&gt;Language-&gt;generateList();</p>
<p>    $this-&gt;set(&#8216;count&#8217;,$count);<br />
    $this-&gt;set(compact(&#8216;languages&#8217;));<br />
}</p>
<p>views/pages/add_many.php :</p>
<p>    &lt;?php for ($i=1;$i</p>
<p>        input(&#8220;Page{$i}.language_id&#8221;);<br />
            echo $form-&gt;input(&#8220;Page{$i}.name&#8221;);<br />
            echo $form-&gt;input(&#8220;Page{$i}.urn&#8221;);<br />
            echo $form-&gt;input(&#8220;Page{$i}.description&#8221;);<br />
            echo $form-&gt;input(&#8220;Page{$i}.keywords&#8221;);<br />
            echo $form-&gt;input(&#8220;Page{$i}.published_from&#8221;);<br />
            echo $form-&gt;input(&#8220;Page{$i}.published_to&#8221;);<br />
            echo $form-&gt;input(&#8220;Page{$i}.published&#8221;);<br />
            echo $form-&gt;input(&#8220;Page{$i}.contents&#8221;);<br />
        ?&gt;</p>
<p>    end(&#8216;Submit&#8217;);?&gt;</p>
<p>            link(__(&#8216;List&#8217;, true).&#8217; &#8216;.__(&#8216;Pages&#8217;, true), array(&#8216;action&#8217;=&gt;&#8217;index&#8217;));?&gt;<br />
            link(__(&#8216;List&#8217;, true).&#8217; &#8216;.__(&#8216;Languages&#8217;, true), array(&#8216;controller&#8217;=&gt; &#8216;languages&#8217;, &#8216;action&#8217;=&gt;&#8217;index&#8217;)); ?&gt;<br />
            link(__(&#8216;New&#8217;, true).&#8217; &#8216;.__(&#8216;Language&#8217;, true), array(&#8216;controller&#8217;=&gt; &#8216;languages&#8217;, &#8216;action&#8217;=&gt;&#8217;add&#8217;)); ?&gt;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
