我正在使用 Zend_Form。我想制作一个忘记密码的表格,就像这样:
标签:[字段] [提交按钮]
我希望它都在一个段落标签中。我希望段落标签位于表单标签内。所以,基本上,我想用 P 标签替换 Zend_Form 的默认 DL 标签。我可以做到,有点,但不完全是。
如果我使用默认值,如下所示:
class Application_Form_Forgot {
public function init() {
// my fields, no special decorators...
}
}
这会产生这个 HTML:
<form {the attributes} ><dl class="zend_form"> {the fields} </dl></form>
我想要这个 HTML:
<form {the attributes} ><p> {the fields} </p></form>
这是我尝试过的:
class Application_Form_Forgot {
public function init() {
// my fields...
$this->setDecorators(
array(
'FormElements',
'Form',
array('HtmlTag', array('tag' => 'p')),
)
);
}
}
但这会产生这个 HTML:
<p><form {the attributes} > {the fields} </form></p>
段落标签围绕着表单。不完全是我想要的。
我也试过:
- 谷歌搜索并阅读 StackOverflow 和其他地方有关如何删除DL 标签的大量帖子。如果我在某处错过了答案,请原谅我,这是重复的。
- 阅读 Zend 源代码以找出一种方法。我找到了 DlDt 装饰器,但这似乎只适用于元素,而不适用于表单。
- 掌握在表单之外放置段落标签并继续我的生活。
有人可以指出我正确的方向吗 - 如果这可能吗?
谢谢,菲利普