I'm using Zend_Form to build a form, and I'd like to align all of the labels
to the right inside their table cells. I can do this with either CSS or the
align="right" attribute of the table cell, but I would need to be able to
set attributes on the tag... which by my read, currently isn't possible.
Sample decorator:
46 $this->setElementDecorators(array(
47 'ViewHelper',
48 'Errors',
49
array('decorator'=>array('td'=>'HtmlTag'),'options'=>array('tag'=>'td')),
50 array('Label',array('tag'=>'td')),
51
array('decorator'=>array('tr'=>'HtmlTag'),'options'=>array('tag'=>'tr')),
52 ));
In Zend_Form_Decorator_Label, we're already using
Zend_Form_Decorator_HtmlTag to render the tag option of the label. Could we
add a tagoptions field to that Label decorator and pass the array of options
through to the Zend_Form_Decorator_HtmlTag?
I'm a bit of a newb to Zend Framework, and this is deep enough inside the
framework to make my head spin a bit, but it looks like a fairly simple
addition. I'm just not sure how to execute it without breaking things
further! I realize that everyone's in a rush to get the last few changes in
before the freeze, but I'd appreciate a hand with this if anyone has the
time.
Thanks,
Karl Katzke