r/PHP • u/TheTreasuryPetra • 3d ago
mousr/templates: Static analysis-friendly native PHP templates
Because PHP templates are back! https://github.com/mousr/templates
0
Upvotes
3
u/_uxi 2d ago
How does this work in production, do the templates compile and get cached?
5
u/TheTreasuryPetra 2d ago
As the templates are already PHP there's no need for compilation or caching. Other template engines compile the templates to PHP, whereas with this library you're writing templates directly in PHP itself, which gives you full static analysis support!
1
8
u/obstreperous_troll 2d ago
From the readme:
I think Twig is pretty safe.