我们如何将 td 添加到 tr 标签中以进行zend_form


How can we to add a td into tr tag for a zend_form?

我想知道很久了。我没有得到正确的zend_form方式。我们如何在zend_form的 tr 标签中添加 td ?那么我们如何在Zend框架中解决这个问题呢?请任何人帮助我。 它看起来像下面的代码:

<table>
      <tr>
       <td><input type='checkbox' id='something'/></td>
       <td><img src='src'/></td>
       <td><input type='text' id='something'/></td>
       <td><input type='radio' group='justonegroup'/></td>
      </tr>
</table>

我的代码是这样的:

          $pollAdd->setDecorators(array('ViewHelper',
            array(array('data' => 'HtmlTag'), array('tag' => 'td')),
            array(array('emptyrow' => 'HtmlTag'), array('tag' => 'td',                 )),
array(array('row' => 'HtmlTag') , array('tag' => 'tr','id'=>'trRowAdd')))); 

    $this->setDecorators(array(
            'FormElements',
            array('HtmlTag' , array('tag' => 'table' , 'class' =>'formTable')),
            'Form'));

使用发送表单集装饰器

像 ,

   $this->setElementDecorators(array(
                'viewHelper',
                'Errors',
                array(array('data'=>'HtmlTag'),array('tag'=>'td')),
                array('Label',array('tag'=>'td')),
                array(array('row'=>'HtmlTag'),array('tag'=>'tr'))
    ),array('firstname','lastname'));

表单本身将具有如下所示的table html 标记,

 $form->setDecorators(array(
    'FormElements',
    array('HtmlTag', array('tag' => 'table')),
    'Form',
  ));