<bdo id='dZNgp'></bdo><ul id='dZNgp'></ul>
  1. <i id='dZNgp'><tr id='dZNgp'><dt id='dZNgp'><q id='dZNgp'><span id='dZNgp'><b id='dZNgp'><form id='dZNgp'><ins id='dZNgp'></ins><ul id='dZNgp'></ul><sub id='dZNgp'></sub></form><legend id='dZNgp'></legend><bdo id='dZNgp'><pre id='dZNgp'><center id='dZNgp'></center></pre></bdo></b><th id='dZNgp'></th></span></q></dt></tr></i><div id='dZNgp'><tfoot id='dZNgp'></tfoot><dl id='dZNgp'><fieldset id='dZNgp'></fieldset></dl></div>

  2. <legend id='dZNgp'><style id='dZNgp'><dir id='dZNgp'><q id='dZNgp'></q></dir></style></legend>
  3. <small id='dZNgp'></small><noframes id='dZNgp'>

      <tfoot id='dZNgp'></tfoot>
    1. 向 Zend Forms 添加一些 html

      时间:2023-10-02

      <small id='O1Ryw'></small><noframes id='O1Ryw'>

            <tbody id='O1Ryw'></tbody>
          <legend id='O1Ryw'><style id='O1Ryw'><dir id='O1Ryw'><q id='O1Ryw'></q></dir></style></legend>

            <bdo id='O1Ryw'></bdo><ul id='O1Ryw'></ul>
              <tfoot id='O1Ryw'></tfoot>
              • <i id='O1Ryw'><tr id='O1Ryw'><dt id='O1Ryw'><q id='O1Ryw'><span id='O1Ryw'><b id='O1Ryw'><form id='O1Ryw'><ins id='O1Ryw'></ins><ul id='O1Ryw'></ul><sub id='O1Ryw'></sub></form><legend id='O1Ryw'></legend><bdo id='O1Ryw'><pre id='O1Ryw'><center id='O1Ryw'></center></pre></bdo></b><th id='O1Ryw'></th></span></q></dt></tr></i><div id='O1Ryw'><tfoot id='O1Ryw'></tfoot><dl id='O1Ryw'><fieldset id='O1Ryw'></fieldset></dl></div>
                本文介绍了向 Zend Forms 添加一些 html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我正在寻找一段简单的代码,可以让我将以下 html 添加到我的 zend 表单中:

                Im looking for a simple bit of code that will let me add the following html into my zend form:

                <div id="wmd-button-bar" class="wmd-panel"></div>

                就是这样,它需要在表单中我的方法"元素之上,仅此而已.对于如此简单的操作,我找不到任何不涉及我学习火箭科学(即 Zend 装饰器)的方法.

                Thats it, it needs to be above my 'method' element in the form but thats it. For such a simple action I cant find any methods that don't involve me learning rocket science (i.e Zend Decorators).

                推荐答案

                目前我能想到的唯一方法是在表单中添加一个虚拟元素并移除除具有您指定属性的 'HtmlTag' 之外的所有装饰器在你的问题中.移除装饰器意味着不会渲染实际元素 - 只会渲染 HtmlTag 装饰器.

                The only way I can think of at the moment is to add a dummy element to the form and remove all decorators except an 'HtmlTag' with the attributes you specified in your question. Removing the decorators means that the actual element will not be rendered - only the HtmlTag decorator will be rendered.

                所以假设你的表单是 $form:

                so assuming your form is $form:

                $form->addElement(
                    'hidden',
                    'dummy',
                    array(
                        'required' => false,
                        'ignore' => true,
                        'autoInsertNotEmptyValidator' => false,
                        'decorators' => array(
                            array(
                                'HtmlTag', array(
                                    'tag'  => 'div',
                                    'id'   => 'wmd-button-bar',
                                    'class' => 'wmd-panel'
                                )
                            )
                        )
                    )
                );
                $form->dummy->clearValidators();
                

                请注意,您要防止对元素进行任何验证.这只是一种方式 - 可能还有其他方式.

                Note that you want to prevent any validation of the element. This is only one way - there are likely others.

                输出:

                <div id="wmd-button-bar" class="wmd-panel"></div>
                

                有一个很好的.

                There is a good article describing decorators.

                这篇关于向 Zend Forms 添加一些 html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:(403) 将事件添加到日历时未配置访问权限 下一篇:ZF2 - 将控制器名称放入布局/视图中

                相关文章

                最新文章

                  <bdo id='p1lTl'></bdo><ul id='p1lTl'></ul>
                1. <legend id='p1lTl'><style id='p1lTl'><dir id='p1lTl'><q id='p1lTl'></q></dir></style></legend>

                2. <tfoot id='p1lTl'></tfoot>
                  <i id='p1lTl'><tr id='p1lTl'><dt id='p1lTl'><q id='p1lTl'><span id='p1lTl'><b id='p1lTl'><form id='p1lTl'><ins id='p1lTl'></ins><ul id='p1lTl'></ul><sub id='p1lTl'></sub></form><legend id='p1lTl'></legend><bdo id='p1lTl'><pre id='p1lTl'><center id='p1lTl'></center></pre></bdo></b><th id='p1lTl'></th></span></q></dt></tr></i><div id='p1lTl'><tfoot id='p1lTl'></tfoot><dl id='p1lTl'><fieldset id='p1lTl'></fieldset></dl></div>
                3. <small id='p1lTl'></small><noframes id='p1lTl'>