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

        <legend id='xrwke'><style id='xrwke'><dir id='xrwke'><q id='xrwke'></q></dir></style></legend>
      1. <small id='xrwke'></small><noframes id='xrwke'>

        <tfoot id='xrwke'></tfoot>

      2. 向 Zend Forms 添加一些 html

        Add some html to Zend Forms(向 Zend Forms 添加一些 html)

        <tfoot id='CDCRi'></tfoot>

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

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

                  <tbody id='CDCRi'></tbody>
                  本文介绍了向 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

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

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

                        • <tfoot id='aePWV'></tfoot>

                          • <bdo id='aePWV'></bdo><ul id='aePWV'></ul>

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