I'm looking for a simple Template engine that works both on client side with JS ánd on server side with PHP.
That means I want to be able to use the same template definition for both use cases.
Do you know any templating engines that have official implementations in both JS and PHP?
PHP is not a template engine, but a language that can be used to write templates, or template engines. A template engine is not just a language, but also the programming API that allows the scripts to locate, organize templates or assign the data from the script to them.
At the moment, when we decide to implement some interactions, react-engine will be the winner. While react-engine rendering does not require JavaScript to run on the client side, it will enable SEO over the search. Template engines also have this SEO support, but with less impact.
If you like JS->PHP priority :) then you have this two jquery-tmpl compatible template renderer for PHP backend
If you prefer more PHP->JS priority :) then you can try this Javascript implementation of popular PHP templating Smarty
Or you can try something more neutral like:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With