Skip to content

Suggest to have 1 as default operand  #4

@hwmaier

Description

@hwmaier

Being a programmer I got taken by surprise how the very handy "If" snippet works as I expected I could simply use it to test a boolean expression without having to specify an operator or operand.

Hence I would suggest the following change:

  • Set default operand to 1

    This can be used then to use a snippet returning the result of a boolean expression as subject without having to specify an operand and would work as one expects. Example:

    isSet snippet: <?php return defined('SOME_CONSTANT') ?>

   [[If? &subject=`[[isSet]]` &then=`true` &else=`false`]]

without that change, the logic is reversed which I find very confusing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions