Skip to content

Feature Request: null coalescing operator in inline fluid #522

@CDRO

Description

@CDRO

I recently stumbled upon a fluid template that made me very sad and so I decided to improve it even more and after I was a little less sad I became a bit sadder nonetheless, because PHP has spoiled me with the null coalescing operator.

What I had:

<span><f:if condition="{model.field}"><f:then>{model.field}</f:then><f:else>Default</f:else></f:if>

What I hoped for:

<span>{model.field ?? 'Default'}</span>

It would be nice to have this feature in Fluid 3 (and even 2, but I guess we should slowly EOL it and push Fluid 3)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions