views:

473

answers:

1

Hello,

I have the following Zend_Form code to apply to form element decorators:

$decorators = array(
        'ViewHelper', 
        'Description',
     array('break' => 'HtmlTag', array('tag' => 'br', 'openOnly'=>true)),
        array('Label', array('class' => 'formLabel', 'separator'=>' ', 'requiredSuffix' => ' <em class="requiredFormElement">(requried)</em>', 'escape'=>false)),
        array('Errors', array('class' => 'formErrors')),
        array(array('row' => 'HtmlTag'), array('tag' => 'div')),
    );

It seems no matter what I do I can't seem to make the Errors show up before the form element (and label) itself. Am I missing something? Everything else seems to be ordered correctly. Can this only be done with a custom decorator?

Thank you in advance.

+1  A: 

Try the following, don't know if it'll work, since I don't have my laptop at the moment:

array('Errors', array('class' => 'formErrors', 'placement' => 'prepend'))
PatrikAkerstrand
Thanks... The prepend thing seems strange to me, since it is not clear what it is relative to. It would be nice if it just rendered the decorators in order that the array is sent - but I suppose I should post that on the Zend Framework site.Thanks again.
supertodda