<?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>eKini Web Developer Blog &#187; zend_form</title>
	<atom:link href="http://blog.ekini.net/tag/zend_form/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ekini.net</link>
	<description>Wenbert Del Rosario: PHP, MySQL, Javascript, MVC, Zend Framework, AJAX, jQuery.</description>
	<lastBuildDate>Tue, 24 Aug 2010 00:13:42 +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>Repost: How to layer decorators</title>
		<link>http://blog.ekini.net/2009/04/06/repost-how-to-layer-decorators/</link>
		<comments>http://blog.ekini.net/2009/04/06/repost-how-to-layer-decorators/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 13:16:09 +0000</pubDate>
		<dc:creator>Wenbert</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[zend_form]]></category>

		<guid isPermaLink="false">http://blog.ekini.net/2009/04/06/repost-how-to-layer-decorators/</guid>
		<description><![CDATA[Seems like Matthew is bored or is tired of all the questions he gets asked regarding Zend_Forms. A few days ago, he was posted this and now he has this: You may have noticed in the previous installment that the decorator&#8217;s render() method takes a single argument, $content. This is expected to be a string. [...]]]></description>
			<content:encoded><![CDATA[<p>Seems like Matthew is bored or is tired of all the questions he gets asked regarding Zend_Form<span class="Apple-style-span" style="text-decoration: line-through">s</span>. A few days ago, he was posted <a href="http://weierophinney.net/matthew/archives/212-The-simplest-Zend_Form-decorator.html">this</a> and now he has this:<br />
<blockquote>You may have noticed in the previous installment that the decorator&#8217;s render() method takes a single argument, $content. This is expected to be a string. render() will then take this string and decide to either replace it, append to it, or prepend it. This allows you to have a chain of decorators &#8212; which allows you to create decorators that render only a subset of the element&#8217;s metadata, and then layer these decorators to build the full markup for the element.</p></blockquote>
<p><a href="http://weierophinney.net/matthew/archives/213-From-the-inside-out-How-to-layer-decorators.html">Click here to view the complete post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ekini.net/2009/04/06/repost-how-to-layer-decorators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The simplest Zend_Form decoration by Matthew Weier O&#8217;Phinney</title>
		<link>http://blog.ekini.net/2009/04/04/the-simplest-zend_form-decoration-by-matthew-weier-ophinney/</link>
		<comments>http://blog.ekini.net/2009/04/04/the-simplest-zend_form-decoration-by-matthew-weier-ophinney/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 04:05:41 +0000</pubDate>
		<dc:creator>Wenbert</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[zend_form]]></category>

		<guid isPermaLink="false">http://blog.ekini.net/2009/04/04/the-simplest-zend_form-decoration-by-matthew-weier-ophinney/</guid>
		<description><![CDATA[This is a re-port from Matthew&#8217;s post. I have not read it yet but the title says it all.]]></description>
			<content:encoded><![CDATA[<p>This is a re-port from Matthew&#8217;s <a href="http://weierophinney.net/matthew/archives/212-The-simplest-Zend_Form-decorator.html">post</a>. I have not read it yet but the title says it all.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ekini.net/2009/04/04/the-simplest-zend_form-decoration-by-matthew-weier-ophinney/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Matthew Weier O&#8217;Phinney&#8217;s posts on Models</title>
		<link>http://blog.ekini.net/2009/01/04/matthew-weier-ophinneys-posts-on-models/</link>
		<comments>http://blog.ekini.net/2009/01/04/matthew-weier-ophinneys-posts-on-models/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 07:24:10 +0000</pubDate>
		<dc:creator>Wenbert</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[models]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[zend_acl]]></category>
		<category><![CDATA[zend_form]]></category>

		<guid isPermaLink="false">http://blog.ekini.net/2009/01/04/matthew-weier-ophinneys-posts-on-models/</guid>
		<description><![CDATA[Here are quick previews to Matthew&#8217;s posts on Zend Framework&#8217;s Models. First up is: Using Zend_Form in Your Models Many other frameworks tie the Model to data access &#8212; typically via the ActiveRecord pattern or a Table Data Gateway &#8212; which completely ignores the fact that this is tying the Model to the method by [...]]]></description>
			<content:encoded><![CDATA[<p>Here are quick previews to Matthew&#8217;s posts on Zend Framework&#8217;s Models.</p>
<p>First up is: <strong>Using Zend_Form in Your Models</strong></p>
<blockquote><p> Many other frameworks tie the Model to data access &#8212; typically via the ActiveRecord pattern or a Table Data Gateway &#8212; which completely ignores the fact that this is tying the Model to the method by which it is persisted. What happens later if you start using memcached? or migrate to an SOA architecture? What if, from the very beginning, your data is coming from a web service? What if you do  use a database, but your business logic relies on associations between tables?</p>
<p>While the aforementioned posts do an admirable job of discussing the various issues, they don&#8217;t necessarily give any concrete approaches a developer can use when creating their models. As such, this will be the first in a series of posts aiming to provide some concrete patterns and techniques you can use when creating your models. The examples will primarily be drawing from Zend Framework components, but should apply equally well to a variety of other frameworks.<br />
Input Filtering and Forms</p>
<p>In most cases, you want your model to perform its own input filtering. The reason is because input filtering is domain logic: it&#8217;s the set of rules that define what input is valid, and how to normalize that input.</p>
<p>However, how does that fit in with forms? Zend Framework has a Zend_Form component, which allows you to specify your validation and filter chains, as well as rules for how to render the form via decorators. The typical pattern is to define a form, and in your controller, pass input to it; if it validates, you then pass the values to the model.</p>
<p>What if you were to instead attach the form to the model?</p>
<p>Some argue that this violates the concept of &#8220;separation of concerns&#8221;, due to the fact that it mixes rendering logic into the model. I feel this is a pedantic argument. When attached to a form, Zend_Form can be used strictly as an input filter; you would pull the form from the model when you wish to render it, and perform any view-specific actions &#8212; configuring decorators, setting the action and method, etc &#8212; within your view script. Additionally, the various plugins &#8212; validators, filters, decorators &#8212; are not loaded until they are used &#8212; meaning there is little to no overhead from the decorators when you merely use Zend_Form as an input filter.</p>
<p>Basically, this approach helps you adhere to the DRY principle (one validation/filter chain), while simultaneously helping you keep a solid separation of business and view logic. Finally, you gain one or more form representations of your model, which helps with rapid application development, as well as providing a solid, semantic tie between the model and the view.</p>
<p>So, on to the technique.<br />
Attaching Forms to Models</p>
<p>What I&#8217;ve been doing is adding a getForm() accessor to my models that takes an optional argument, the type of form to retrieve. This is then used within the model any time validation is necessary. (Some models require multiple forms, so best to plan for it early. A good example is a model that represents a user &#8212; you will need a login and registration form.) Let&#8217;s look at it in action:</p></blockquote>
<p>Click <a href="http://weierophinney.net/matthew/archives/200-Using-Zend_Form-in-Your-Models.html">here</a> to see the complete post.</p>
<p>And then <strong>Applying ACL to Models</strong>.</p>
<blockquote><p> Zend_Acl is divided into three areas of responsibility:</p>
<p>    * Resources are objects to which access is controlled<br />
    * Roles are objects which may request access to one or more resources<br />
    * ACLs provide a tree structure to which resources and roles may be added, and which map access rules between them.</p>
<p>Zend_Acl is primarily engineered to be configured and manipulated programmatically. While you can certainly write functionality to pull the information out of a data store &#8212; say, an LDAP directory or a database &#8212; in many cases, you don&#8217;t need to. Let&#8217;s look at this simple ACL definition: </p></blockquote>
<p><a href="http://weierophinney.net/matthew/archives/201-Applying-ACLs-to-Models.html">Here</a> for the second post.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ekini.net/2009/01/04/matthew-weier-ophinneys-posts-on-models/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework Tutorial: A Fully Customized Form Using Zend_Form and Decorators (UPDATED now using Tables)</title>
		<link>http://blog.ekini.net/2008/10/29/zend-framework-a-fully-customized-form-using-zend_form-and-decorators/</link>
		<comments>http://blog.ekini.net/2008/10/29/zend-framework-a-fully-customized-form-using-zend_form-and-decorators/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 09:21:17 +0000</pubDate>
		<dc:creator>Wenbert</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[decorators]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[zend_form]]></category>

		<guid isPermaLink="false">http://blog.ekini.net/?p=493</guid>
		<description><![CDATA[This tutorial is derived from this post. So I suggest that you read weirophinney&#8217;s post first before this. This method of rendering a form can be more verbose, but it also allows you to tweak the form at almost infinitely whole still gaining the advantages of error reporting, labeling, etc that decorators provide (by using [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial is derived from this <a href="http://devzone.zend.com/article/3450-Decorators-with-Zend_Form">post</a>. So I suggest that you read <a href="http://devzone.zend.com/article/3450-Decorators-with-Zend_Form">weirophinney&#8217;s post</a> first before this.</p>
<blockquote><p>This method of rendering a form can be more verbose, but it also allows you to tweak the form at almost infinitely whole still gaining the advantages of error reporting, labeling, etc that decorators provide (by using the decorators associated with the elements).</p></blockquote>
<p>I would like to stress out the advantages:</p>
<ul>
<li>Error Reporting</li>
<li>And Labelling</li>
</ul>
<p>You get these by doing only this in your view script (.phtml file):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">firstname</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">lastname</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Looking good? Well, here is the rest of it.</p>
<p>First, create this file: <strong>application/forms/sample/sampleform.php</strong></p>
<p>Inside sampleform.php, you should have something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #000000; font-weight: bold;">class</span> forms_sample_sample2form <span style="color: #000000; font-weight: bold;">extends</span> Zend_Form
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$checkboxDecorator</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                                    <span style="color: #0000ff;">'ViewHelper'</span><span style="color: #339933;">,</span>
                                    <span style="color: #0000ff;">'Errors'</span><span style="color: #339933;">,</span>
                                    <span style="color: #0000ff;">'Description'</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HtmlTag'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'td'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Label'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'td'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'element'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'row'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'HtmlTag'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'tr'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$elementDecorators</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                                    <span style="color: #0000ff;">'ViewHelper'</span><span style="color: #339933;">,</span>
                                    <span style="color: #0000ff;">'Errors'</span><span style="color: #339933;">,</span>
                                    <span style="color: #0000ff;">'Description'</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HtmlTag'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'td'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Label'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'td'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'element'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'row'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'HtmlTag'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'tr'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$buttonDecorators</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                                    <span style="color: #0000ff;">'ViewHelper'</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HtmlTag'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'td'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                    <span style="color: #666666; font-style: italic;">//array('Label',array('tag' =&gt; 'td')), NO LABELS FOR BUTTONS</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'row'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'HtmlTag'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'tr'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setAction</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setMethod</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addElement</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'text'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'email'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'decorators'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">elementDecorators</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'label'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Email:'</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'required'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'validators'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                            <span style="color: #0000ff;">'EmailAddress'</span><span style="color: #339933;">,</span>
                            <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'attribs'</span> <span style="color: #339933;">=&gt;</span>   <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                                <span style="color: #0000ff;">'id'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'email_id'</span><span style="color: #339933;">,</span>
                                <span style="color: #0000ff;">'class'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'email_class'</span>
                            <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addElement</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'text'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'age'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'decorators'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">elementDecorators</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'label'</span>      <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Age:'</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'required'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addElement</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'select'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'country'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'decorators'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">elementDecorators</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'label'</span>      <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Country:'</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'required'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'attribs'</span> <span style="color: #339933;">=&gt;</span>   <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                                <span style="color: #0000ff;">'id'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'country_id'</span><span style="color: #339933;">,</span>
                            <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'multioptions'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                            <span style="color: #0000ff;">'ph'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Philippines'</span><span style="color: #339933;">,</span>
                            <span style="color: #0000ff;">'us'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'USA'</span><span style="color: #339933;">,</span>
                            <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addElement</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'text'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'username'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'decorators'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">elementDecorators</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'label'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Username:'</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'validators'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                                <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'stringLength'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">255</span><span style="color: #009900;">&#41;</span>
                            <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'required'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addElement</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'text'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'firstname'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'decorators'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">elementDecorators</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'label'</span>      <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'First Name:'</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'required'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addElement</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'text'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'lastname'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'decorators'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">elementDecorators</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'label'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Last Name:'</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'required'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addElement</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'radio'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'gender'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'decorators'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">elementDecorators</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'label'</span>      <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Gender:'</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'required'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'attribs'</span> <span style="color: #339933;">=&gt;</span>   <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                                <span style="color: #0000ff;">'id'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'gender_id'</span><span style="color: #339933;">,</span>
                            <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'multioptions'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                            <span style="color: #0000ff;">'male'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Male'</span><span style="color: #339933;">,</span>
                            <span style="color: #0000ff;">'female'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Female'</span><span style="color: #339933;">,</span>
                            <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$checkboxDecorator</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                                <span style="color: #0000ff;">'ViewHelper'</span><span style="color: #339933;">,</span>
                                <span style="color: #0000ff;">'Errors'</span><span style="color: #339933;">,</span>
                                <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'data'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'HtmlTag'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'span'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'element'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Label'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'dt'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'row'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'HtmlTag'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'span'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                            <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addElement</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'checkbox'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'agreement'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'decorators'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$checkboxDecorator</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'label'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Agreement:'</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'required'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addElement</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'submit'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'save'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'decorators'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">buttonDecorators</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'label'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Save'</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> loadDefaultDecorators<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setDecorators</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'FormElements'</span><span style="color: #339933;">,</span>
            <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HtmlTag'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'table'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'Form'</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'Errors'</span>
        <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Then inside one of my controller-action, I have this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> sample2Action<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">require_once</span>  <span style="color: #0000ff;">'forms/sample/sampleform.php'</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$form</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> forms_sample_sampleform<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">//get the request object</span>
        <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isPost</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isValid</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPost</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #666666; font-style: italic;">//do some saves here</span>
                <span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPost</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$form</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now, in my view script. These are the .phtml files.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;h4&gt;Please register with us!&lt;/h4&gt;
&lt;form action=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">escape</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAction</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; method=&quot;&lt; ?= $this-&gt;escape($this-&gt;form-&gt;getMethod()) ?&gt;&quot;&gt;
&nbsp;
&lt;fieldset&gt;
    &lt;legend&gt;Demographics&lt;/legend&gt;
&nbsp;
        Please provide us the following information so we can know more about
        you.
&nbsp;
    &lt; ?= $this-&gt;form-&gt;age ?&gt;
    &lt; ?= $this-&gt;form-&gt;country ?&gt;
&nbsp;
&lt;/fieldset&gt;
&nbsp;
&lt;fieldset&gt;
    &lt;legend&gt;User Information&lt;/legend&gt;
&nbsp;
        Now please tell us who you are and how to contact you.
&nbsp;
    &lt; ?= $this-&gt;form-&gt;username ?&gt;
    &lt; ?= $this-&gt;form-&gt;firstname ?&gt;
    &lt; ?= $this-&gt;form-&gt;lastname ?&gt;
    &lt; ?= $this-&gt;form-&gt;email ?&gt;
    &lt; ?= $this-&gt;form-&gt;gender ?&gt;
    &lt; ?= $this-&gt;form-&gt;agreement ?
&nbsp;
&lt;/fieldset&gt;
&nbsp;
&lt; ?= $this-&gt;form-&gt;save ?&gt;
&lt;/form&gt;</pre></div></div>

<p>Enjoy!</p>
<p>Feel free to comment/suggest&#8230; ;)</p>
<p><em>Some references in order to help you understand the form decorators ($elementDecorators, etc.) can be found in this <a href="http://www.nabble.com/Zend_Form-Decorators-explanation-to20261370.html#a20279920">thread</a> from Nabble Zend Framework.</em></p>
<p>UPDATE:<br />
The $elementDecorators variable above might seem a little bit confusing, so here is another example on how to handle it. This one sets a &#8220;class&#8221; for the first cell and the second cell of the table.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$elementDecorators</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                                    <span style="color: #0000ff;">'Label'</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'labelTd'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'HtmlTag'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                          <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'td'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'class'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'label_cell'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'elemTdOpen'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'HtmlTag'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                          <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'td'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'openOnly'</span><span style="color: #339933;">=&gt;</span>true<span style="color: #339933;">,</span>
                                                <span style="color: #0000ff;">'class'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'input_cell'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'placement'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'append'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                    <span style="color: #0000ff;">'ViewHelper'</span><span style="color: #339933;">,</span>
                                    <span style="color: #0000ff;">'Errors'</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Description'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'div'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'elemTdClose'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'HtmlTag'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                          <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'td'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'closeOnly'</span><span style="color: #339933;">=&gt;</span>true<span style="color: #339933;">,</span> <span style="color: #0000ff;">'placement'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'append'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'row'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'HtmlTag'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'tr'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$checkboxDecorator</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                                    <span style="color: #0000ff;">'ViewHelper'</span><span style="color: #339933;">,</span>
                                    <span style="color: #0000ff;">'Errors'</span><span style="color: #339933;">,</span>
                                    <span style="color: #0000ff;">'Description'</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HtmlTag'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'td'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Label'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'td'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'element'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Description'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'span'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'row'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'HtmlTag'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'tr'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$buttonDecorators</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                                    <span style="color: #0000ff;">'ViewHelper'</span><span style="color: #339933;">,</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HtmlTag'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'td'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                    <span style="color: #666666; font-style: italic;">//array('Label',array('tag' =&gt; 'td')), NO LABELS FOR BUTTONS</span>
                                    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'row'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'HtmlTag'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'tr'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.ekini.net/2008/10/29/zend-framework-a-fully-customized-form-using-zend_form-and-decorators/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Zend Framework How To: Creating your own validator for confirm passwords and emails</title>
		<link>http://blog.ekini.net/2008/05/14/zend-framework-how-to-creating-your-own-validator-for-confirm-passwords-and-emails/</link>
		<comments>http://blog.ekini.net/2008/05/14/zend-framework-how-to-creating-your-own-validator-for-confirm-passwords-and-emails/#comments</comments>
		<pubDate>Wed, 14 May 2008 09:55:15 +0000</pubDate>
		<dc:creator>Wenbert</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[validators]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[zend_form]]></category>

		<guid isPermaLink="false">http://blog.ekini.net/?p=419</guid>
		<description><![CDATA[Last night I was working on the registration page of my pet-project. I am using Zend_Form for it but I had difficulties creating a validator to confirm 2 fields in the form. I chatted around #zftalk and checked the ZF Documentation but I could not understand anything. I needed a concrete working example. Today I [...]]]></description>
			<content:encoded><![CDATA[<p>Last night I was working on the registration page of my pet-project. I am using Zend_Form for it but I had difficulties creating a validator to confirm 2 fields in the form. I chatted around #zftalk and checked the ZF Documentation but I could not understand anything. I needed a concrete working example.</p>
<p>Today I found <a href="http://cogo.wordpress.com/2008/04/16/custom-validators-for-zend_form_element/">this</a>. It has more or less a complete coverage with sample source-code and some explanation.</p>
<blockquote><p>My “register user” form consists of four elements:</p>
<ul>
<li>Email</li>
<li>Confirm email</li>
<li>Confirm password</li>
<li>Password</li>
</ul>
</blockquote>
<p>Exactly what I was looking for ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ekini.net/2008/05/14/zend-framework-how-to-creating-your-own-validator-for-confirm-passwords-and-emails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
