如何自定义 Zend_Form_Element_Select
如何在 Zend_Form_Element_Select
的选项值之间放置空格 预期结果如下,
尝试如下,
$this->addElement('Select', 'parent_id', array(
'label' => 'Select Category',
'multiOptions' => array('0'=>'Gents','1'=>' Jeans','2'=>' Sunglass','3'=>'Ladies','4'=>' Jeans','5'=>' Sunglass')
));
但失败,
任何帮助请
How to put space in between option value of Zend_Form_Element_Select
Expected result as follows,
Tried as follows,
$this->addElement('Select', 'parent_id', array(
'label' => 'Select Category',
'multiOptions' => array('0'=>'Gents','1'=>' Jeans','2'=>' Sunglass','3'=>'Ladies','4'=>' Jeans','5'=>' Sunglass')
));
but fails,
Any help please
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么不直接使用optgroups? ZF 通过使用多选项的嵌套数组来本地处理此问题,例如
此处更新的演示 - http://jsfiddle。净/HLbQE/1/
Why not just use optgroups? ZF handles this natively by using a nested array for the multi-options, eg
Updated demo here - http://jsfiddle.net/HLbQE/1/
试试这个:我似乎这确实行不通,正如本报告所述,仍未解决,问题:
http://framework.zend.com/issues/browse/ZF-5351
Try this:I seems this will not work indeed, as reported in this, still unresolved, issue:
http://framework.zend.com/issues/browse/ZF-5351