Skip to content

Switch from php templating to Twig #920

Open
@hemberger

Description

@hemberger

We currently use PHP templating to render the display pages. We may want to consider incrementally migrating to Twig (https://twig.symfony.com/doc/) instead.

Benefits:

  • One of the most standard PHP templating libraries.
  • Enforces a serializable, read-only data model (whereas PHP templating still has access to our PHP libraries and can modify the state of existing objects and databases).
  • The syntax is less verbose {{ bla }} vs. <?php echo $bla; ?> and has many convenient functions for manipulating the data (e.g. escaping etc.).

Downsides:

  • It's an entirely new language that must be learned to maintain our codebase.
  • It creates a dependency on an external library (though it is so popular that it is unlikely to be abandoned).
  • The additional overhead likely would incur a small runtime penalty.

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