Zend Form_element包含在包含文本

|的html标签中或附加到其中。 在Zend_Form中,是否可以使用装饰器在元素前面加上一对包含文本的html标签? 例如:
<div>My text inside html tags prepended..</div><input type=\'text\'>
编辑: 如果我想将表单元素放在仍然包含文本的html标记对中怎么办? 例如
<div>
 This div is containing both my custom text and my form element: 
 <input type=\'text\'>
</div>
谢谢 路卡     
已邀请:
只需使用
 $element->setDescription(\"My text\");
您也可以根据需要使用标签。 如果需要,您还可以使用HtmlTag帮助程序供装饰器使用,并将位置设置为PREPEND。 编辑
$elementDecorators = array(
                                \'ViewHelper\',
                                array(\'Label\', array( \'tag\' => \'span\', \'placement\' => \'prepend\')),
                                array(\'Description\', array( \'tag\' => \'div\', \'placement\' => \'append\',\'class\'=>\'eDesc\')),                                
                                array(\'HtmlTag\', array( \'tag\' => \'div\', \'class\'=>\'userElement\'))
);

$element->setDecorators( $elementDecorators);
    

要回复问题请先登录注册