Yesterday @userfriendly posted a interesting Question on Freenode/#symofony:
He asked about how to add class attributes to the <option>
Tags of a EntityType.php form field.
After looking at the code we found out that this is not possible at all with the native behavior of the EntityType or with any <select>
field.
Then I had the idea to work the variables I can access without making changes to the Symfony2 Modules. Here is the solution: