RE: Would the site benefit from using a templating library?
| From: | me at mikevanriel dot com | Date: | Sat, 02 Jul 2022 12:19:30 +0000 |
| Subject: | RE: Would the site benefit from using a templating library? | ||
| References: | 1 2 | Groups: | php.webmaster |
| Request: | Send a blank email to php-webmaster+get-30229@lists.php.net to get a copy of this message | ||
> There is a general issue with this: we have a hard time to rely on third-party packages, to
> avoid endorsing one over others. This topic has been discussed many times over the years, and
> rarely went anywhere.
Hmm, I sympathize with trying to remain completely neutral; I do wonder however if this doesn't
hurt contributions to this project, and what signal this sends. It may send out the signal that one
should always roll their own code and not depend on libraries.
Perhaps there is another way to send the message that using packages does not mean endorsing them,
and/or selecting packages from creators that are independent from frameworks. One such example in
this specific case could be Plates (https://platesphp.com/). That library is not affiliated with any
of the frameworks but can still be of significant benefit. Plates can even be seen as a more natural
extension since it does not put a pseudo-layer on the templates but instead reuses PHP's native
way of integrating in HTML.
Another option if one would really want to forfeit any association with a vendor may be to use XSLT
templates -as lib/xslt is a pecl extension- but one may wonder if that really makes things simpler
😊 (although it is a natural fit to the Atom source files used).
Disclaimer: I am not affiliated with any of the above, I even prefer Twig as a templating engine
above quite a few other, but I take the presented argument seriously and offer alternate suggestions
that could help people contribute to this project.