加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 如何使用Zend表单描述添加自定义HTML标记

发布时间:2020-12-13 14:15:14 所属栏目:PHP教程 来源:网络整理
导读:考虑我想展示 复选框,复选框标签和之后的图像. 如何使用Zend Engine Form创建相同的视图 我尝试如下 $this-addElement( 'Checkbox',"$key",array( 'label'=$value,'checkedValue' = "$key",'uncheckedValue' = '','checked' = true,'disabled' = false,) );
考虑我想展示

复选框,复选框标签和之后的图像.

如何使用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);

这将防止转义描述内容.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读