Zend Framework Decorators - Labels and Checkboxes

Very often it is the smallest things that annoy us the most. It took me a while to figure out why the placement parameter was not changing anything. I started of with the following:

'decorators' => array( array('Label'), array('ViewHelper') )

Unfortunately switching the order between Label and ViewHelper did not change the order of elements. So I found this parameter called “placement”.

'decorators' => array( array('Label', array('placement' => 'APPEND')), array('ViewHelper') )

It can take two values: PREPEND or APPEND. At this point however I did not realize that now the order of Label and ViewHelper did matter. Only the order below will make any difference to the html elements order.

'decorators' => array( array('ViewHelper'), array('Label', array('placement' => 'APPEND')) )

This finally resulted in the desired effect.