Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from php templating to Twig #920

Open
hemberger opened this issue Nov 16, 2020 · 0 comments
Open

Switch from php templating to Twig #920

hemberger opened this issue Nov 16, 2020 · 0 comments

Comments

@hemberger
Copy link
Member

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant