ZF-5867: Decorator "options" array details

Description

The documentation for Zend_form decorators is lacking with enough options. Actually the options array needs to be described in detail so that one can try out different variations. For example: I am trying to make a three column table (inside a zend_form) with the first being "label", second one being "form field" (e.g text-box, check-box, radio-button, dropdown) and third one being "description" but not able to get the correct HTML generated using the following decorator:


        $this->setElementDecorators(array(
            array('ViewHelper'),
            array('Errors'),
            array('Description', array('tag' => 'td')),
            array('HtmlTag', array('tag' => 'td')),
            array('Label', array('tag' => 'td')),
            array(array('row' => 'HtmlTag'),array('tag' => 'tr'))
        ));

which gives me the following HTML:


NameUnique identifier used to label a Name

You can very well see the two "" tags together which is causing problem.

Also if I use the Dojo widgets (e.g. ValidationTextBox), the moment, I enable the decorators on the form, the "promptMessage" and "invalidMessage" stops being displayed. Wondering whether it had to do something with the decorators or not !!!

Comments

The order is important. I think you can get the expected HTML with the following.

 
$this->setElementDecorators(array(
  array('ViewHelper'),
  array('Errors'),
  array('HtmlTag', array('tag' => 'td')),
  array('Description', array('tag' => 'td')),
  array('Label', array('tag' => 'td')),
  array(array('row' => 'HtmlTag'),array('tag' => 'tr'))
));

I agree with you that the documentation is poor. For example the doc should explain how to set the attributes 'options' => array('style' => 'color:red;') and how to call $formErrors->setElementStart.