<?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: Symfony Form: unsetAllFieldsExcept()</title>
	<atom:link href="http://www.devexp.eu/2009/04/27/symfony-form-unsetallfieldsexcept/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.devexp.eu/2009/04/27/symfony-form-unsetallfieldsexcept/</link>
	<description>DEVelopment EXPerience, shared with the world!</description>
	<lastBuildDate>Mon, 06 Sep 2010 10:41:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Van de Voorde Toni</title>
		<link>http://www.devexp.eu/2009/04/27/symfony-form-unsetallfieldsexcept/comment-page-1/#comment-219</link>
		<dc:creator>Van de Voorde Toni</dc:creator>
		<pubDate>Mon, 04 May 2009 07:41:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.devexp.eu/?p=706#comment-219</guid>
		<description>That&#039;s good news :)</description>
		<content:encoded><![CDATA[<p>That&#8217;s good news <img src='http://www.devexp.eu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.devexp.eu/2009/04/27/symfony-form-unsetallfieldsexcept/comment-page-1/#comment-218</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 04 May 2009 07:31:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.devexp.eu/?p=706#comment-218</guid>
		<description>Today I discovered that symfony 1.3 will include an sfForm::useFields() method that will do exactly what your unsetAllFieldsExcept() does:
http://trac.symfony-project.org/changeset/17824</description>
		<content:encoded><![CDATA[<p>Today I discovered that symfony 1.3 will include an sfForm::useFields() method that will do exactly what your unsetAllFieldsExcept() does:<br />
<a href="http://trac.symfony-project.org/changeset/17824" rel="nofollow">http://trac.symfony-project.org/changeset/17824</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas R.</title>
		<link>http://www.devexp.eu/2009/04/27/symfony-form-unsetallfieldsexcept/comment-page-1/#comment-205</link>
		<dc:creator>Thomas R.</dc:creator>
		<pubDate>Wed, 29 Apr 2009 09:08:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.devexp.eu/?p=706#comment-205</guid>
		<description>This is more a security problem. If you add new fields in your model, then fields will appear on the form. Not always what we need.

I have coded a similar function with a optional parameter to reorder field.

http://trac.symfony-project.org/browser/plugins/swToolboxPlugin/sf1.2/trunk/lib/form/swToolboxFormHelper.class.php#L270</description>
		<content:encoded><![CDATA[<p>This is more a security problem. If you add new fields in your model, then fields will appear on the form. Not always what we need.</p>
<p>I have coded a similar function with a optional parameter to reorder field.</p>
<p><a href="http://trac.symfony-project.org/browser/plugins/swToolboxPlugin/sf1.2/trunk/lib/form/swToolboxFormHelper.class.php#L270" rel="nofollow">http://trac.symfony-project.org/browser/plugins/swToolboxPlugin/sf1.2/trunk/lib/form/swToolboxFormHelper.class.php#L270</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Van de Voorde Toni</title>
		<link>http://www.devexp.eu/2009/04/27/symfony-form-unsetallfieldsexcept/comment-page-1/#comment-204</link>
		<dc:creator>Van de Voorde Toni</dc:creator>
		<pubDate>Wed, 29 Apr 2009 07:26:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.devexp.eu/?p=706#comment-204</guid>
		<description>Correct for the performance issue. 

If in the form you create you need to unset/reinitialize at least one field then it&#039;s better to override the setup function and initialize it from the first time correctly. 

The problem is that those (important) things are not well documented in symfony (yet), and some developers do not take the time to &#039;investigate&#039; what happens in the super classes.

I saw a lot of form examples where the developers &quot;re-set&quot; there widgets/validators in the configure method instead of the setup function. The configure method, which is correctly named, is only to configure the existing widgets/validators (options etc).

If I have the time I&#039;ll do some benchmarking on the &#039;unsetting&#039; fields to see how much performance drop there is.</description>
		<content:encoded><![CDATA[<p>Correct for the performance issue. </p>
<p>If in the form you create you need to unset/reinitialize at least one field then it&#8217;s better to override the setup function and initialize it from the first time correctly. </p>
<p>The problem is that those (important) things are not well documented in symfony (yet), and some developers do not take the time to &#8216;investigate&#8217; what happens in the super classes.</p>
<p>I saw a lot of form examples where the developers &#8220;re-set&#8221; there widgets/validators in the configure method instead of the setup function. The configure method, which is correctly named, is only to configure the existing widgets/validators (options etc).</p>
<p>If I have the time I&#8217;ll do some benchmarking on the &#8216;unsetting&#8217; fields to see how much performance drop there is.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.devexp.eu/2009/04/27/symfony-form-unsetallfieldsexcept/comment-page-1/#comment-201</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 28 Apr 2009 18:59:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.devexp.eu/?p=706#comment-201</guid>
		<description>I&#039;d go for the second one (unsetAllFieldsExcept()). I might even need this myself soon to clean up some of my forms ;-)

What I don&#039;t like about this though is that it is very inefficient from a performance point of view. It just seems wrong to me to create a form with 20+ widgets and validators just to kill 19 of them immediately. Perhaps I should think about this a little more...</description>
		<content:encoded><![CDATA[<p>I&#8217;d go for the second one (unsetAllFieldsExcept()). I might even need this myself soon to clean up some of my forms <img src='http://www.devexp.eu/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>What I don&#8217;t like about this though is that it is very inefficient from a performance point of view. It just seems wrong to me to create a form with 20+ widgets and validators just to kill 19 of them immediately. Perhaps I should think about this a little more&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
