在一行上显示 Zend_Form_Element_Radio
Zend Framework 中的单选按钮显示在一列中(每行一个选项)。 如何从标记中删除 br 标签,以便所有单选选项保留在一行中?
我的装饰者是:
private $radioDecorators = array(
'Label',
'ViewHelper',
array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'radio')),
array(array('row' => 'HtmlTag'), array('tag' => 'li')),
);
The radio buttons in Zend Framework are displayed in a column (one option per line). How can I remove the br tag from the markup so that all radio options stay in one line?
My decorators are:
private $radioDecorators = array(
'Label',
'ViewHelper',
array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'radio')),
array(array('row' => 'HtmlTag'), array('tag' => 'li')),
);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要在 Zend_Form_Element_Radio 对象上调用 setSeparator 方法,并传递它“”。 这是此处的示例:
You need to call the setSeparator method on the Zend_Form_Element_Radio object, passing it ''. Here's an example from here:
使用如下选项
这将通过 ' ' 进行单选分隔
use options as follows
This will make radio seperation by ' '
使用 Zend_Form_Element_Radio::setSeparator($separator) 方法:
例如
分隔符默认为 '\<\br />' 如 getSeparator() 所示。
Use the Zend_Form_Element_Radio::setSeparator($separator) method:
e.g.
The separator defaults to '\<\br />' as shown by getSeparator().