Php Zend表单复选框元素自定义
我有一个zend表单,上面有一些元素,包括一个复选框。 看起来很正常:Php Zend表单复选框元素自定义,php,zend-framework,zend-form,Php,Zend Framework,Zend Form,我有一个zend表单,上面有一些元素,包括一个复选框。 看起来很正常: checkbox label [] 我想在右侧添加一个链接,使其看起来像这样: checkbox label [] thelink 我尝试了以下方法,但没有将描述与复选框水平对齐,而是将其放在下面: $boolean->setDescription('desc'); $boolean->setDecorators(array( 'ViewHelper',
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的乞丐。你知道我该怎么做吗
谢谢明白了
我是这样做的:
$boolean->setDescription('description');
$boolean->setDecorators(array(
'ViewHelper',
'Description',
'Errors',
array('HtmlTag', array('tag' => 'dd')),
array('Label', array('tag' => 'dt')),
array('Description', array('escape' => false, 'tag' => '', 'placement' => 'append')),
));
我想你可能需要一个电话。请看一看被接受的答案,我认为它可能会为您指明正确的方向。请尝试更改dd标记的样式(宽度、浮动等)<代码>$element->getDecorator('HtmlTag')->setOption('style','width:20px;')代码>