I felt the same way at first. What I did then was just set all element
decorators to ViewHelper and manually code the markup in the view script,
putting <?= $this->form->element ?> where the elements should appear. You
lose the nifty things like labels, descriptions and validation error
messages, but those can be laid out manually as well by obtaining the
relevant information from the form object.

Then my forms started getting big and I got sick of the constant
copy-pasting, so I forced myself to learn decorators. I don't do this
anymore except in forms with very complex markups, I use the ViewScript
decorator which works in a similar way.

One thing that got me while learning decorators is that you need to use an
alias if you need to use a decorator type multiple times in the same
element. It has a nice huge box by itself in the manual, but I still missed
it somehow.



On Sun, Oct 19, 2008 at 3:19 AM, Steven Szymczak <[EMAIL PROTECTED]
> wrote:

> I'm in the process of [attempting] to create a simple login form, using
> Zend_Form for the very first time.  So far I'm failing, even after reading
> the docs.
>
> The part that's really getting me are decorators.  I know what they're
> supposed to do, I just can't figure out how to use them :o  All that this
> form contains are two text inputs: username and password.  I want the
> resulting form to look like:
>
> Username: <username_input>
> Password: <password_input>
> <submit>
>
> However, I can't figure out how to alter the decorators in order to
> accomplish this, short of writing my own decorator classes; and I'm sure
> there must be an easier way.
>
> Sorry for my extreme newbiness...
>

Reply via email to