Suggested addition to SelectViewHelper - allowing prepend/append of child content to rendered option tag list
This is a simple but functional and useful addition to the SelectViewHelper. It adds two new boolean attributes: prependContent and appendContent. Setting one of these to TRUE (with preference for prependContent if both are TRUE) makes the ViewHelper either append of prepend the innerHTML.
It also removes the REQUIRED annotation from the $options tag - explanation of why this is good follows.
<f:form.select prependContent="TRUE"> <option value="-1">I am the first value</option> </f:form.select> // outputs... <select ...> <option value="-1">I am the first value</option> <option...> // all further options </select>
Of course appendContent=TRUE places the first option below the others, not above.
The logic should be solid enough to advocate the change of the options argument. It should make
complete sense to the developer that, if options are left out, they either need to be supplied as an argument as per the Fluid standard - or defined as the content of the tag as per the HTML standard.
Patch performed on 4.5.2 sysext fluid source.