Fluid icon indicating copy to clipboard operation
Fluid copied to clipboard

Inline conditions

Open s2b opened this issue 1 year ago • 1 comments

Now that Fluid supports boolean literals (like {true}), the next step would be to support more advanced conditions not just in ConditionViewHelpers but right in the inline variable syntax.

Example:

<my:viewhelper disabled="{myString == 'test'}" />
<my:viewhelper disabled="{myString == 'test' && byBool}" />

This can probably be implemented with an ExpressionNode, however we need to be careful to not break existing expressions.

Related: #911

s2b avatar Aug 11 '24 07:08 s2b

Not as elegant, but with #1031 at least the following syntax will be possible:

<my:viewhelper disabled="{f:if(condition: '{myString} == \'test\'')}" />
<my:viewhelper disabled="{f:if(condition: '{myString} == \'test\' && {myBool}')}" />

s2b avatar Feb 11 '25 18:02 s2b