【发布时间】:2023-04-07 06:47:01
【问题描述】:
我有一个带有一些元素的 zend 表单,包括一个复选框。 看起来很正常:
checkbox label []
我想在右侧添加一个链接,使其看起来像这样:
checkbox label [] thelink
我尝试了以下方法,但不是将描述与复选框水平对齐,而是将其置于其下方:
$boolean->setDescription('desc');
$boolean->setDecorators(array(
'ViewHelper',
'Description',
'Errors',
array('HtmlTag', array('tag' => 'dd')),
array('Label', array('tag' => 'dt')),
));
我是 Zend Forms 的初学者。知道如何实现吗?
谢谢
【问题讨论】:
-
我认为您可能需要decorator。看看this SO question 接受的答案,我认为它可能会为您指明正确的方向。
-
尝试更改 dd 标签的样式(宽度、浮动等)。
$element->getDecorator('HtmlTag')->setOption('style', 'width:20px;');
标签: php zend-framework zend-form