The decorators work by taking the output of the previous decorator and
prepending and/or appending new content. In your last example:
'ViewHelper' -> generates <input> tag
'Errors' -> appends errors, if any
'Description' -> appends description, if any
array('HtmlTag', -> takes the input, errors and description if
any,
array('tag'=>'td')) prepends <td>, appends </td>
array('Label', -> generates a <label class="element">,
array('tag'=>'td', wraps it in <td></td>, prepends
'class' => 'element')) it to the output of HtmlTag
array(array('row'=>'HtmlTag'), -> wraps the whole thing in <tr></tr>
array('tag'=>'tr'))
Note in the Label, it uses HtmlTag if you specify a tag, but it doesn't pass
any option to it aside from the tag itself. So you cannot set the class of
the tag this way. You have to specify different HtmlTag decorators for the
<td> wrappers of the label.
On Sat, Nov 1, 2008 at 7:02 PM, wenbert <[EMAIL PROTECTED]> wrote:
> $elementDecorators = array(
> 'ViewHelper', //this is
> different from your example above?
> 'Errors', //so is
> this?
> 'Description', //this
> too...
> array('HtmlTag',array('tag' => 'td')),
> //from initially looking at this, this encloses the "label"?
> array('Label',array('tag' =>
> 'td','class' =>'element')), //this says Label, but it encapsulates the
> "element"? im confused :-(
> array(array('row' => 'HtmlTag'),
> array('tag' => 'tr'))); // This part. this encloses everything?
> </pre>
> i'm not sure. maybe it is just the readability of the code i just pasted
> (maybe you can help me reformat it so that it would be easier to
> understand?)...
>
> -----
> http://blog.ekini.net
> --
> View this message in context:
> http://www.nabble.com/Zend_Form-Decorators-explanation-tp20261370p20279280.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>
--
-- Mon