<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Home of Peter Haza &#187; Symfony</title>
	<atom:link href="http://blog.peterhaza.no/category/programming/php/symfony/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.peterhaza.no</link>
	<description>Opinions on most things</description>
	<lastBuildDate>Sat, 28 Nov 2009 12:36:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Using lists instead of tables with sfGuardAuth</title>
		<link>http://blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/</link>
		<comments>http://blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/#comments</comments>
		<pubDate>Tue, 13 May 2008 12:25:41 +0000</pubDate>
		<dc:creator>Peter Haza</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>

		<guid isPermaLink="false">http://blog.peterhaza.no/?p=43</guid>
		<description><![CDATA[For some reason, symfony 1.1&#8242;s new sfForm class is using sfWidgetFormSchemaFormatterTable by default, instead of sfWidgetFormSchemaFormatterList. This means that you get a form based on tables, while I prefer to think of my form as a list to fill in. To change this you can use this chain: $form-&#62;getWidgetSchema()-&#62;setFormFormatterName('list'); The question is, &#8220;where do you [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason, <a href="http://www.symfony-project.org/" onclick="pageTracker._trackPageview('/outgoing/www.symfony-project.org/?referer=');">symfony</a> 1.1&#8242;s new sfForm class is using sfWidgetFormSchemaFormatterTable by default, instead of sfWidgetFormSchemaFormatterList. This means that you get a form based on 
tables, while I prefer to think of my form as a list to fill in. To change this you can use this chain:</p>

<pre><code>$form-&gt;getWidgetSchema()-&gt;setFormFormatterName('list');
</code></pre>

<p>The question is, &#8220;where do you put this to alter sfGuard&#8217;s login form?&#8221;</p>

<p><span id="more-43"></span></p>

<p>In the case of sfGuard you just need to create a new folder under apps/<em>frontend</em>/modules/ (replace frontend with your app name) called sfGuardAuth, in this you create a folder called actions, and within this again a file called actions.class.php.</p>

<pre><code>apps/
-frontend/
--modules/
---sfGuardAuth/
----actions/
-----actions.class.php
</code></pre>

<p>Inside the actions.class.php file you put this:</p>

<pre><code>&lt;?php
    require_once sfConfig::get('sf_plugins_dir').
    '/sfGuardDoctrinePlugin/modules/sfGuardAuth/lib/BasesfGuardAuthActions.class.php';

/**
* Extend to use list schema formatter
*/
class sfGuardAuthActions extends BasesfGuardAuthActions
{
    public function executeSignin($request)
    {
        parent::executeSignin($request);
        $this-&gt;form-&gt;getWidgetSchema()-&gt;setFormFormatterName('List');
    }
}
?&gt;
</code></pre>

<p>We manually include BasesfGuardAuthActions.class.php because symfony&#8217;s black magic autoloader doesn&#8217;t pick this up. Voila. Nice and easy!</p>

<p>If you wanna make your completely own sfWidgetFormSchemaFormatter you can read about it over at <a href="http://notjosh.com/blog/archives/53-Symfony-1.1-Form-Templating.html" onclick="pageTracker._trackPageview('/outgoing/notjosh.com/blog/archives/53-Symfony-1.1-Form-Templating.html?referer=');">notjosh&#8217;s blog</a>.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/&amp;title=Using+lists+instead+of+tables+with+sfGuardAuth" rel="nofollow" class="external" title="Share this on del.icio.us" onclick="pageTracker._trackPageview('/outgoing/delicious.com/post?url=http_//blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/_amp_title=Using+lists+instead+of+tables+with+sfGuardAuth&amp;referer=');">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/&amp;t=Using+lists+instead+of+tables+with+sfGuardAuth" rel="nofollow" class="external" title="Share this on Facebook" onclick="pageTracker._trackPageview('/outgoing/www.facebook.com/share.php?v=4_amp_src=bm_amp_u=http_//blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/_amp_t=Using+lists+instead+of+tables+with+sfGuardAuth&amp;referer=');">Share this on Facebook</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/&amp;title=Using+lists+instead+of+tables+with+sfGuardAuth" rel="nofollow" class="external" title="Share this on Reddit" onclick="pageTracker._trackPageview('/outgoing/reddit.com/submit?url=http_//blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/_amp_title=Using+lists+instead+of+tables+with+sfGuardAuth&amp;referer=');">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/&amp;title=Using+lists+instead+of+tables+with+sfGuardAuth" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon" onclick="pageTracker._trackPageview('/outgoing/www.stumbleupon.com/submit?url=http_//blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/_amp_title=Using+lists+instead+of+tables+with+sfGuardAuth&amp;referer=');">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Using+lists+instead+of+tables+with+sfGuardAuth+-+http://blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!" onclick="pageTracker._trackPageview('/outgoing/twitter.com/home?status=Using+lists+instead+of+tables+with+sfGuardAuth+-+http_//blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/_amp_source=shareaholic&amp;referer=');">Tweet This!</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/&amp;title=Using+lists+instead+of+tables+with+sfGuardAuth" rel="nofollow" class="external" title="Digg this!" onclick="pageTracker._trackPageview('/outgoing/digg.com/submit?phase=2_amp_url=http_//blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/_amp_title=Using+lists+instead+of+tables+with+sfGuardAuth&amp;referer=');">Digg this!</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Using%20lists%20instead%20of%20tables%20with%20sfGuardAuth%22&amp;body=Link: http://blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A For%20some%20reason%2C%20%5Bsymfony%5D%5B%5D%201.1%27s%20new%20sfForm%20class%20is%20using%20sfWidgetFormSchemaFormatterTable%20by%20default%2C%20instead%20of%20sfWidgetFormSchemaFormatterList.%20This%20means%20that%20you%20get%20a%20form%20based%20on%20%0Atables%2C%20while%20I%20prefer%20to%20think%20of%20my%20form%20as%20a%20list%20to%20fill%20in.%20To%20change%20this%20you%20can%20use%20this%20chain%3A%0A%0A%20%20%20%20" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://blog.peterhaza.no/using-lists-instead-of-tables-with-sfguardauth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
