Zend_Form:带有复选框的 HTML 表中的数据库记录

我正在尝试将 HTML 多列表添加到 Zend_Form.该表将由数据库中的数据填充,每行前面应有一个复选框,如下面的 ASCII 所示:

I am trying to add a HTML multi-column table to a Zend_Form. The table would be populated by data from the database and each row should be preceded by a checkbox, as shown in the ASCII below:

+-----+-------------------------+-----------------------+--------------+
|     | Column_1                | Column_2              | Column_3     |
+-----+-------------------------+-----------------------+--------------+
| [x] | Row #1                  | Some data             | more data    |
+-----+-------------------------+-----------------------+--------------+
| [x] | Row #2                  | Some data             | more data    |
+-----+-------------------------+-----------------------+--------------+
| [x] | Row #3                  | Some data             | more data    |
+-----+-------------------------+-----------------------+--------------+

该表将处理多对多关系.有人会碰巧知道如何实现这一点吗?

The table would handle many-to-many relationships. Would anyone happen to know how to implement this?

推荐答案

至少你必须移除 DtDd Decorator,将 Html Decorator 标签设置为div 并删除 Label 装饰器.

At the very least you'll have to remove DtDd Decorator, set the Html Decorator tag to div and remove the Label Decorator.

我建议你尽可能地制作表格,然后从那里开始工作,至少试一试.

I suggest you make the form as best you can then work from that, at least give it a go.

在最坏的情况下,您将不得不编写自己的表单元素来复制此 HTML.

In the worst situation you will have to write your own form elements to replicate this HTML.

相关文章