在 Zend SubForm 中,如何将 Legend escape 设置为 false?

发布于 2024-09-30 14:31:41 字数 358 浏览 3 评论 0原文

我有一个子表单,我在其中设置了图例。

$dob = new Zend_Form_SubForm();
$dob->addElement($birthdayMonth)
->addElement($birthdayDay)
->setLegend('when is your birthday?');

如何设置图例,使其不会转义文本?

通常我会得到装饰器,但这不起作用:

$decorator = $dob->getDecorator('Legend');
$decorator->setOption('escape', false); 

I've got a subform, where I set a legend.

$dob = new Zend_Form_SubForm();
$dob->addElement($birthdayMonth)
->addElement($birthdayDay)
->setLegend('when is your birthday?');

How do I set the Legend so it won't escape the text?

Usually I'd get the decorator, but this doesn't work:

$decorator = $dob->getDecorator('Legend');
$decorator->setOption('escape', false); 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

稍尽春風 2024-10-07 14:31:41

您可以设置 Fieldset 装饰器,它将其传递给 Legend 字段。

$dob->getDecorator('Fieldset')
    ->setOption('escape', false);

You can set the Fieldset decorator, it passes it to the Legend field.

$dob->getDecorator('Fieldset')
    ->setOption('escape', false);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文