Skip to content

Possible legal values for parameters #151

Open
@ulrichmathes

Description

@ulrichmathes

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions