Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Fall through for f:switch ViewHelper #417

Open
TheNaderio opened this issue Nov 7, 2018 · 3 comments
Open

Feature request: Fall through for f:switch ViewHelper #417

TheNaderio opened this issue Nov 7, 2018 · 3 comments

Comments

@TheNaderio
Copy link

A fall through option for f:switch viewhelper would be a very nice to have.

Something like:

<f:switch expression="{expr}">

    <f:case value="val1"/>
    <f:case value="val2"/>
    <f:case value="val3">
        on one of this cases
    </f:case>

    <f:case value="val4">
        on val4
    </f:case>

    <f:defaultCase>
        default
    </f:case>

</f:switch>

Or maybe

<f:switch expression="{expr}">

    <f:case value="val1" fallthrough="val3"/>
    <f:case value="val2" fallthrough="val3"/>
    <f:case value="val3">
        on one of this cases
    </f:case>

    <f:case value="val4">
        on val4
    </f:case>

    <f:defaultCase>
        default
    </f:case>

</f:switch>

that would help in many cases where the same result should come out.

@p410n3
Copy link

p410n3 commented Apr 2, 2019

Me too thanks

@OrangeLeinad
Copy link

I can confirm that request too.

@bmack
Copy link
Member

bmack commented May 18, 2021

How about:

<f:switch expression="{expr}">
    <f:case value="val3" additionalValues="{val1, val2}">
        on one of this cases
    </f:case>

    <f:case value="val4">
        on val4
    </f:case>

    <f:defaultCase>
        default
    </f:defaultCase>

</f:switch>

I'd also love to get an expression such as

<f:case value="val1 || val2 || val3">

to handle such cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants