ZF-3580: add CLASS= html attribute for Zend/View/Helper/FormSelect.php, like:

Issue Type: New Feature Created: 2008-07-04T07:29:18.000+0000 Last Updated: 2012-06-08T17:17:01.000+0000 Status: Open Fix version(s): Reporter: Fabrice Terrasson (fterrasson) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_View

Related issues: - ZF-11254



Some javascript frameworks use arbitrary tags, for example Dojo can use class="dojoDndItem" to make some <OPTIONS drag and dropable.

The protected function _build($value, $label, $selected, $disable) into Zend/View/Helper/FormSelect.php lacks of optionnal CLASS= html attrib. for each OPTION. what about a new function _build($value, $label, $selected, $disable, $optionalsAttribs= null) ? with $optionalsAttribs an associative array like ;

$optionalsAttribs= array( 'class' => 'dojoDndItem', 'dndType'=> 'foo'); ... renders:

It can be done programmatically in js.


Posted by Wil Sinclair (wil) on 2008-07-04T12:38:02.000+0000

It's all you. :)

Posted by Martin (lolek19) on 2011-04-02T22:19:32.000+0000

My fix: [] Example with red background: $combobox = new Zend_Form_Element_Select('list'); $combobox->addMultiOption('value', 'visibleText', array('style'=>'background-color: #FF0000;'));

Posted by Jérémy Huet (jhuet) on 2011-09-15T15:25:20.000+0000

Martin, your paste link is dead, could you share your code again please ? Thanks.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.