Skip to content

Support for human-readable booleans #11

@fracz

Description

@fracz

The only thing that I really miss from this template engine is a support for different placeholders for booleans.

For example:

$engine->render("The engine is turned {status|on|off}.", ['status' => true]); // The engine is turned on
$engine->render("The engine is turned {electricity|on|off}.", ['electricity' => false]); // The light is turned off

Do you have an idea how this could be added?

Of course, I can use ternary operator in the values, but when it comes to real case (i.e. the data comes from 3rd party library) it would be much simpler to place the desired values in the template.

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