Need help understanding Zend_Form decorator rendering
I have
$title = new Zend_Form_Element_Text('title', array('size'=>'20'));
$title->setLabel('Title')
->addValidator('NotEmpty')
->setDecoratorsarray(
'ViewHelper',
array(array('dataz'=>'HtmlTag'), array('tag' => 'div', 'class' => 'input')),
array('Label', array('tag' => 'td')),
array('row'=>'HtmlTag', array('tag' => 'div','class'=>'element')),
);
I need help understanding how to set parameters.
- Why do we first point ViewHelper not the end?
- Why 2 times html tag between the label?
If I change their position, it doesn't render correctly.
Why only in last option would you want to warp elements (label and input) in the div with class "element"? If I only define HtmlTag
once it warps only input elements together, not 开发者_如何转开发 both label and input.
How do I wrap both elements?
$title = new Zend_Form_Element_Text('title', array('size'=>'20'));
$title->setLabel('Title')
->addValidator('NotEmpty')
->setDecorators(array(
'ViewHelper',
array(array('dataz'=>'HtmlTag'), array('tag' => 'div', 'class' => 'input')),
array('Label', array('tag' => 'td')),
array('row'=>'HtmlTag', array('tag' => 'div','class'=>'element')),
));
Sorry it was some mistake in code.
精彩评论