ZF2.3.3 FormSelect <optgroup> doesn't accept HTML5 attributes

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ZF2.3.3 FormSelect <optgroup> doesn't accept HTML5 attributes

cmple
Hi,
It seems like the <optgroup> tag only accepts 2 attributes:

Zend\Form\View\Helper\FormSelect.php [Line:61]
protected $validOptgroupAttributes = array(
        'disabled' => true,
        'label'    => true,
    );

Is there a way to add a valid HTML5 global parameter to it?
for example:
..array(
        'label' => 'Optgroup Label',
        'options' => array(...options...),
        'attributes' => array(
                'class' => 'optgroup-class',
        ),
),

As per the following doc:
http://www.w3.org/TR/html-markup/optgroup.html
Permitted attributes: global attributes & label & disabled

Thanks!
Roman.