<?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>Chris Antoine &#187; Zend Config</title>
	<atom:link href="http://www.chrisantoine.com/tag/zend-config/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chrisantoine.com</link>
	<description>PHP / MySQL / JavaScript / Ajax Development.</description>
	<lastBuildDate>Fri, 13 Nov 2009 03:11:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Prettier Accessible Forms with Zend Form and Zend Config</title>
		<link>http://www.chrisantoine.com/2008/07/15/prettier-accessible-forms-with-zend-form-and-zend-config/</link>
		<comments>http://www.chrisantoine.com/2008/07/15/prettier-accessible-forms-with-zend-form-and-zend-config/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 04:23:10 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Prettier Accessible Forms]]></category>
		<category><![CDATA[Zend Config]]></category>
		<category><![CDATA[Zend Form]]></category>

		<guid isPermaLink="false">http://www.chrisantoine.net/?p=22</guid>
		<description><![CDATA[When I first started working with Zend Framework and showed a designer the output from Zend Form we had a few days of conversations back and forth and researched on whether or not the dl/dt setup was going to be sufficient for what we wanted and also &#8220;correct usage&#8221;. While working through our first project [...]]]></description>
			<content:encoded><![CDATA[<p>When I first started working with <a title="Zend Framework" href="http://framework.zend.com" target="_blank">Zend Framework</a> and showed a designer the output from <a title="Zend Form" href="http://framework.zend.com/manual/en/zend.form.html" target="_blank">Zend Form</a> we had a few days of conversations back and forth and researched on whether or not the dl/dt setup was going to be sufficient for what we wanted and also &#8220;correct usage&#8221;.</p>
<p>While working through our first project we ran into issues with this structure of forms.  I didn&#8217;t run into any problems but in order to stop the complaints from the designers in our office I decided to work on getting <a title="Zend Form" href="http://framework.zend.com/manual/en/zend.form.html" target="_blank">Zend Form</a> to generate forms in the style laid out at <a title="Prettier Accessible Forms" href="http://www.alistapart.com/articles/prettyaccessibleforms" target="_blank">A List Apart.</a></p>
<p>I didn&#8217;t figure this would really be all that difficult because most of the documentation for <a title="Zend Framework" href="http://framework.zend.com" target="_blank">Zend Framework</a> fairly good.  Little did I know that the documentation and examples for <a title="Zend Form" href="http://framework.zend.com/manual/en/zend.form.html" target="_blank">Zend Form</a> with <a title="Zend Config" href="http://framework.zend.com/manual/en/zend.config.html" target="_blank">Zend Config</a> were fairly hard to find.  When I did find documentation the decorators stilled confused me for a while.  Then everything just seemed to click one day and I was successful in getting exactly what I wanted.  Now I don&#8217;t have designers complaining anymore because they have forms structured exactly the way they want(Sorry Rob <img src='http://www.chrisantoine.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ).  In order to get the results I wanted I ended up with a form defined in my ini file like the following:</p>
<pre>[signInForm]
form.id = "signInForm"
form.method = "post"
form.action = "/sign-in/"

; Form Decorators
form.disableLoadDefaultDecorators = true
form.decorators.formElements.decorator = "FormElements"
form.decorators.description.decorator = "Description"
form.decorators.form.decorator = "Form"

; Global Element Decorators
form.elementDecorators.decorator = "ViewHelper"
form.elementDecorators.error.decorator = "Errors"
form.elementDecorators.description.decorator = "Description"
form.elementDecorators.label.decorator = "Label"
form.elementDecorators.formElements.decorator = "HtmlTag"
form.elementDecorators.formElements.options.tag = "li"

; Group Decorators
form.displayGroupDecorators.decorator = "FormElements"
form.displayGroupDecorators.formElements.decorator = "HtmlTag"
form.displayGroupDecorators.formElements.options.tag = "ol"
form.displayGroupDecorators.fieldset.decorator = "Fieldset"

; Form Groups
form.displayGroups.signinGroup.elements.username    = "username"
form.displayGroups.signinGroup.elements.password    = "password"
form.displayGroups.signinGroup.elements.rememberMe  = "rememberMe"

form.displayGroups.submitGroup.elements.submit = "submit"

; username element
form.elements.username.type = "text"
form.elements.username.options.validators.notempty.validator = "NotEmpty"
form.elements.username.options.validators.notempty.breakChainOnFailure = true
form.elements.username.options.validators.strlen.validator = "StringLength"
form.elements.username.options.validators.strlen.options.min = 6
form.elements.username.options.validators.strlen.options.max = 20
form.elements.username.options.required = true
form.elements.username.options.label = "Username:"

; password element
form.elements.password.type ="password"
form.elements.password.options.validators.notempty.validator = "NotEmpty"
form.elements.password.options.validators.notempty.breakChainOnFailure = true
form.elements.password.options.validators.strlen.validator = "StringLength"
form.elements.password.options.validators.strlen.options.min = "6"
form.elements.password.options.required = true
form.elements.password.options.label = "Password:"

; remember me element
form.elements.rememberMe.type = "checkbox"
form.elements.rememberMe.options.label = "Remember Me?"

; login button element
form.elements.submit.type = "button"
form.elements.submit.options.name = "SignIn"
form.elements.submit.options.value = "Sign In"
form.elements.submit.options.label = "Sign In"</pre>
<p>I hope this helps someone else as I could not find a good solid example of how to get this working.  If anyone has any feedback on a better way of handling this let me know in the comments.<br />
Thanks,<br />
Chris</p>
<p>Update<br />
I updated &#8220;FieldSet&#8221; to &#8220;Fieldset&#8221; as that has changed since I wrote this post.  Thanks for the message about the error!<br />
Chris</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisantoine.com/2008/07/15/prettier-accessible-forms-with-zend-form-and-zend-config/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

