【问题标题】:create a table in td using zend decorator使用 zend 装饰器在 td 中创建一个表
【发布时间】:2011-04-15 12:18:21
【问题描述】:

我正在使用 zend 表单和 zend 装饰器。

我想在父表的 td 中创建一个子表。像这样:

<table>
  <tr>
   <td>Username:</td>
   <td>
     <table>
      <tr>
       <td> <input type="text"> </td>
       <td> <img/> </td>
      </tr>
     </table>
   </td>
  </tr>
</table>

如何创建此表。 谁能帮帮我。

【问题讨论】:

    标签: zend-framework zend-form zend-decorators


    【解决方案1】:

    这可能不是最好的解决方案,因为您也许可以创建自己的装饰器来呈现表单(使用子表)。但是你总是可以单独渲染每个表单元素,使用 renderViewHelper() 函数

    <table>
      <tr>
       <td>Username:</td>
       <td>
         <table>
          <tr>
           <td><?php echo $this->form->username->renderViewHelper() ?></td>
           <td> <img/> </td>
          </tr>
         </table>
       </td>
      </tr>  <tr>
       <td>AnotherElement:</td>
       <td>
         <table>
          <tr>
           <td><?php echo $this->form->anotherElement->renderViewHelper() ?></td>
           <td> <img/> </td>
          </tr>
         </table>
       </td>
      </tr>
    </table>
    

    【讨论】:

      猜你喜欢
      • 2011-01-24
      • 2017-11-16
      • 2011-01-10
      • 2015-03-28
      • 1970-01-01
      • 2012-04-18
      • 2012-10-23
      • 2011-07-13
      • 1970-01-01
      相关资源
      最近更新 更多