【发布时间】:2011-08-10 09:43:03
【问题描述】:
请就使用 Zend 表单装饰器在 HTML 标记之间插入诸如“#”、“名称”和“数字”之类的值提出建议。谢谢
<thead>
<tr>
<th>#</th>
<th>Name</th>
<th>Number</th>
</tr>
</thead>
编辑: @Asuraya澄清:我已经能够使用下面的装饰器代码生成上面所需的结构。但是,它在标签中没有“#”、“名称”和“编号”的情况下呈现。我一直想不出插入值的方法。
$subform->setDecorators(array(
'FormElements',
array(array('th1' => 'HtmlTag'), array('tag' => 'th')),
array(array('th2' => 'HtmlTag'), array('tag' => 'th')),
array(array('th3' => 'HtmlTag'), array('tag' => 'th')),
array(array('row' => 'HtmlTag'), array('tag' => 'tr')),
array(array('thead' => 'HtmlTag'), array('tag' => 'thead')),
array(array('tbody' => 'HtmlTag'), array('tag' => 'tbody', 'placement' => 'APPEND')),
array(array('table' => 'HtmlTag'), array('tag' => 'table', 'id' => 'tabdata')),
'Form',
));
【问题讨论】:
标签: zend-framework zend-form zend-decorators