2008年8月6日星期三

[fw-mvc] Trying to understand Decorators

I'm trying to understand how to create custom decorators. I've read the page at http://devzone.zend.com/article/3450-decorators-with-zend_form and I'm studying the examples in it.

However, I can't work out how this:

$number = new Zend_Form_Element_Text('number');
$number->setLabel('Extension Number')

//Taken straight from the web page
$number->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')), array('Label', array('tag' => 'td'), array(array('row' => 'HtmlTag'), array('tag' => 'tr')),)));

turns into this HTML:

<td><label for="number" class="required">Extension Number</label></td>
<td class="element">
<input type="text" name="number" id="number" value="48457"></td>

Can someone help me please ?

Thanks,

GTG

没有评论: