php - Symfony2 - add attribute/class to single select option -
having form select field like:
$builder->add('foo', new choicetype, $this->defaults + [ 'choices' => [/* choices key->value*/], ]); i add class of options, renders like:
<select> <option value="1">foo</option> <option value="2">bar</option> <option value="3" class="showmodal">baz</option> </select> how achieve it? important thing inside form type, not in template.
similar problem has been described: here, input field.
Comments
Post a Comment