Issue Feature Closed

#77275Opposite of IfViewHelper

Daniel Corn 07/28/16, 10:05 updated 07/28/16, 11:02

Description

I think it would be good to have an inverse version of the IfViewHelper.

For me the following workaround is not very pretty:

    <f:if condition="{condition}">
        <f:then> </f:then>
        <f:else>This is the important part</f:else>
    </f:if>

My suggestion is to introduce the UnlessViewHelper, like in [Handlebars](http://handlebarsjs.com/builtin_helpers.html#unless)

    <f:unless condition="{hopeFullyFalse}">
        Alright, the variable is false
    </f:unless>

    <f:unless condition="{hopeFullyFalse}">
        <f:then>Alright, the variable is false</f:then>
        <f:else>Sorry the variable is true</f:else>
    </f:unless>

PS: Sorry if this is a duplicate

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.