考虑我想展示
复选框,复选框标签和之后的图像.
如何使用Zend Engine Form创建相同的视图
我尝试如下
$this->addElement( 'CheckBox',"$key",array( 'label'=>$value,'checkedValue' => "$key",'uncheckedValue' => '','checked' => true,'disabled' => false,) ); $element = $this->getElement($key); $element->setDecorators( array( 'ViewHelper',array('Label',array('tag' => 'dt','class'=>'hidden')),array('Description',array('escape'=>false,'tag'=>' span')),//escape false because I want html output ) ); $element->setDescription('<img name="help_'.$key.'" id="help_'.$key.'" src="/application/modules/User/externals/images/what-is-this.gif"/>'); $element->setDescription('<img name="help_'.$key.'" id="help_'.$key.'" src="/application/modules/User/externals/images/what-is-this.gif"/>');
请帮忙
$element->getDecorator('Description')->setEscape(false);
这将防止转义描述内容.