Aad*_*adi 9 php zend-framework zend-form
考虑我想展示
复选框,复选框标签和之后的图像.
如何使用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"/>');
Run Code Online (Sandbox Code Playgroud)
但显示复选框,描述图像和复选框标签为上标.
请帮忙
小智 20
$element->getDecorator('Description')->setEscape(false);
Run Code Online (Sandbox Code Playgroud)
这将防止转义描述内容.
| 归档时间: |
|
| 查看次数: |
9329 次 |
| 最近记录: |