I am currently trying to build a simple custom layer that I will extend instead of Zend_Form. For instance, My_Form.
I want all my forms to look the same so I am setting this in My_Form. Here is what it is so far.
class My_Form extends Zend_Form
{
protected $_elementDecorators = array(
'ViewHelper',
'Errors',
array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'value_cell')),
array('Label', array('tag' => 'td')),
array(array('row' => 'HtmlTag'), array('tag' => 'tr')),
);
}
And all of my forms will extend this. Now this is working, the problem comes with the $_elementDecorators array. I am wrapping the Label in a "td" and the Label Decorator is applying the default "id" to that "td" but I am wanting to add a class to that "td" as well.
Is there anyway to accomplish this, with this array? If not, is there a better way to do this? Or if so, can someone please describe to me how this array works?
Desired result:
<tr>
<td class='label_cell'>
<label />
</td>
<td class='value_cell'>
<input />
</td>
</tr>
Thank you.