<?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: Why sfContext::getInstance() Is Bad</title>
	<atom:link href="http://webmozarts.com/2009/07/01/why-sfcontextgetinstance-is-bad/feed/" rel="self" type="application/rss+xml" />
	<link>http://webmozarts.com/2009/07/01/why-sfcontextgetinstance-is-bad/</link>
	<description>On The Art Of Web Development</description>
	<lastBuildDate>Sun, 10 Jul 2011 10:30:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Relaying Doctrine events to symfony &#171; Destroy every zig!</title>
		<link>http://webmozarts.com/2009/07/01/why-sfcontextgetinstance-is-bad/comment-page-1/#comment-10460</link>
		<dc:creator>Relaying Doctrine events to symfony &#171; Destroy every zig!</dc:creator>
		<pubDate>Wed, 20 Apr 2011 07:53:33 +0000</pubDate>
		<guid isPermaLink="false">http://webmozarts.com/?p=380#comment-10460</guid>
		<description>[...] If you need to relay your Doctrine events to symfony, you might get tempted to create a dependency to sfContext in your models. As we all know (right?) this is a path straight down to hell. [...]</description>
		<content:encoded><![CDATA[<p>[...] If you need to relay your Doctrine events to symfony, you might get tempted to create a dependency to sfContext in your models. As we all know (right?) this is a path straight down to hell. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GizmoLA.com</title>
		<link>http://webmozarts.com/2009/07/01/why-sfcontextgetinstance-is-bad/comment-page-1/#comment-8478</link>
		<dc:creator>GizmoLA.com</dc:creator>
		<pubDate>Tue, 18 Jan 2011 22:26:49 +0000</pubDate>
		<guid isPermaLink="false">http://webmozarts.com/?p=380#comment-8478</guid>
		<description>&lt;strong&gt;Load the Url symfony helper in a model or form class...&lt;/strong&gt;

I&#039;m doing some symfony work and needed to use the Url helper in a form class to return an error message that included a link. I would consider this one of those exceptions where you really need to be able to have markup in a class rather than in a tem...</description>
		<content:encoded><![CDATA[<p><strong>Load the Url symfony helper in a model or form class&#8230;</strong></p>
<p>I&#8217;m doing some symfony work and needed to use the Url helper in a form class to return an error message that included a link. I would consider this one of those exceptions where you really need to be able to have markup in a class rather than in a tem&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Utiliser l&#8217;objet user dans un formuaire symfony &#187; Fisti</title>
		<link>http://webmozarts.com/2009/07/01/why-sfcontextgetinstance-is-bad/comment-page-1/#comment-4573</link>
		<dc:creator>Utiliser l&#8217;objet user dans un formuaire symfony &#187; Fisti</dc:creator>
		<pubDate>Mon, 30 Aug 2010 03:06:26 +0000</pubDate>
		<guid isPermaLink="false">http://webmozarts.com/?p=380#comment-4573</guid>
		<description>[...] en contre-exemple, car j&#8217;ai pu souvent la trouver sur certains blogs ou forums, à tort (ici un très bon article, en anglais, qui explique [...]</description>
		<content:encoded><![CDATA[<p>[...] en contre-exemple, car j&#8217;ai pu souvent la trouver sur certains blogs ou forums, à tort (ici un très bon article, en anglais, qui explique [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bernhard</title>
		<link>http://webmozarts.com/2009/07/01/why-sfcontextgetinstance-is-bad/comment-page-1/#comment-2008</link>
		<dc:creator>Bernhard</dc:creator>
		<pubDate>Fri, 05 Mar 2010 15:08:09 +0000</pubDate>
		<guid isPermaLink="false">http://webmozarts.com/?p=380#comment-2008</guid>
		<description>@Interested: Just inject the I18N instance into the form. I&#039;m doing that too. 

$form = new myForm($i18n, ...);

And concerning the helpers... it&#039;s probably better not to use them at all and rely on the underlying implementation. format_date(), f.i., is just a wrapper for sfNumberFormat. So use sfNumberFormat instead.

@John: What do you mean? In the form? Inject them.</description>
		<content:encoded><![CDATA[<p>@Interested: Just inject the I18N instance into the form. I&#8217;m doing that too. </p>
<p>$form = new myForm($i18n, &#8230;);</p>
<p>And concerning the helpers&#8230; it&#8217;s probably better not to use them at all and rely on the underlying implementation. format_date(), f.i., is just a wrapper for sfNumberFormat. So use sfNumberFormat instead.</p>
<p>@John: What do you mean? In the form? Inject them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://webmozarts.com/2009/07/01/why-sfcontextgetinstance-is-bad/comment-page-1/#comment-2007</link>
		<dc:creator>John</dc:creator>
		<pubDate>Fri, 05 Mar 2010 15:00:08 +0000</pubDate>
		<guid isPermaLink="false">http://webmozarts.com/?p=380#comment-2007</guid>
		<description>How is it possible to get &quot;multiple sfUser instances&quot; ?</description>
		<content:encoded><![CDATA[<p>How is it possible to get &#8220;multiple sfUser instances&#8221; ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Interested</title>
		<link>http://webmozarts.com/2009/07/01/why-sfcontextgetinstance-is-bad/comment-page-1/#comment-2006</link>
		<dc:creator>Interested</dc:creator>
		<pubDate>Fri, 05 Mar 2010 14:57:45 +0000</pubDate>
		<guid isPermaLink="false">http://webmozarts.com/?p=380#comment-2006</guid>
		<description>And how about I18n or other helpers loading in Form, or Model class (sfContext::getInstance()-&gt;getConfiguration()-&gt;loadHelpers(&#039;I18N&#039;);)</description>
		<content:encoded><![CDATA[<p>And how about I18n or other helpers loading in Form, or Model class (sfContext::getInstance()-&gt;getConfiguration()-&gt;loadHelpers(&#8216;I18N&#8217;);)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christopher Shennan</title>
		<link>http://webmozarts.com/2009/07/01/why-sfcontextgetinstance-is-bad/comment-page-1/#comment-1911</link>
		<dc:creator>Christopher Shennan</dc:creator>
		<pubDate>Tue, 16 Feb 2010 15:57:19 +0000</pubDate>
		<guid isPermaLink="false">http://webmozarts.com/?p=380#comment-1911</guid>
		<description>I&#039;ve usually come across this when using sfForm and I get around this by using the constructor injector mentioned above but pass the object I want as an option i.e. 

$form = new myForm(array(), array(&#039;sf_guard_user&#039; =&gt; $user));

Passing it in this manner allows me to access it in the form class via $this-&gt;options[&#039;sf_guard_user&#039;];</description>
		<content:encoded><![CDATA[<p>I&#8217;ve usually come across this when using sfForm and I get around this by using the constructor injector mentioned above but pass the object I want as an option i.e. </p>
<p>$form = new myForm(array(), array(&#8216;sf_guard_user&#8217; =&gt; $user));</p>
<p>Passing it in this manner allows me to access it in the form class via $this-&gt;options['sf_guard_user'];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jwesker</title>
		<link>http://webmozarts.com/2009/07/01/why-sfcontextgetinstance-is-bad/comment-page-1/#comment-1849</link>
		<dc:creator>jwesker</dc:creator>
		<pubDate>Thu, 04 Feb 2010 18:27:27 +0000</pubDate>
		<guid isPermaLink="false">http://webmozarts.com/?p=380#comment-1849</guid>
		<description>@gpilotino, Yeah, how is sfContext::getInstace() avoidable from the generator, and also from the form classes? is it possible to inject dependency on the forms too?</description>
		<content:encoded><![CDATA[<p>@gpilotino, Yeah, how is sfContext::getInstace() avoidable from the generator, and also from the form classes? is it possible to inject dependency on the forms too?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Clark</title>
		<link>http://webmozarts.com/2009/07/01/why-sfcontextgetinstance-is-bad/comment-page-1/#comment-1309</link>
		<dc:creator>David Clark</dc:creator>
		<pubDate>Thu, 03 Dec 2009 14:23:02 +0000</pubDate>
		<guid isPermaLink="false">http://webmozarts.com/?p=380#comment-1309</guid>
		<description>THANKS ;
I  have been struggling with dependency injection forever, this really helps!</description>
		<content:encoded><![CDATA[<p>THANKS ;<br />
I  have been struggling with dependency injection forever, this really helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gpilotino</title>
		<link>http://webmozarts.com/2009/07/01/why-sfcontextgetinstance-is-bad/comment-page-1/#comment-990</link>
		<dc:creator>gpilotino</dc:creator>
		<pubDate>Mon, 09 Nov 2009 15:35:26 +0000</pubDate>
		<guid isPermaLink="false">http://webmozarts.com/?p=380#comment-990</guid>
		<description>I can see another situation where you cannot avoid using sfContext::getInstance(): the admin generator.
(ie. how can you have a table_method / peer_method filtered on user credentials without accessing context from the Model ?)</description>
		<content:encoded><![CDATA[<p>I can see another situation where you cannot avoid using sfContext::getInstance(): the admin generator.<br />
(ie. how can you have a table_method / peer_method filtered on user credentials without accessing context from the Model ?)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

