Open
Description
It would be nice to define possible legal values for an parameter. Without having to introduce a custom data structure.
<fc:param name="align" type="string" cases="{'left', 'right'}" />
// or more slimline with cases fromString:
<fc:param name="align" type="string" cases="left,right" />
// or ?
<fc:param name="align" type="string" cases="left|right" />
I think an implementation would not a big deal.
I thought about to enable enum
as parameter type but we would not be able to pass an enum case in an fluid template. So the value of the parameter would be a string anyway. To then pass the string to the tryFrom
function of the enum does not feel right and overdone.
Maybe enum will have usecases but for many cases I can think of now, a simple list, defined within the parameter tag would be very handy.
[written on smartphone, pull request will follow]