I am looking for a good template system (preferably XML-based) that provides implementations both for PHP and Javascript.
This would enable me to write templates for some elements that are either:
– Populated on server side : when simply displaying those, in “reader” mode.
– Or instantiated / populated on client side : when creating new instances of these objects, in the admin backend, using Javascript.
Does such a system exist? Or maybe an there is alternative to handle those needs ?
It is not XML-based, but the only one I know available in JS and PHP is mustache, which is a fairly simple template engine, but it’s getting very popular in the JS community.
And if you are using PHP5.3, Matthew Weier O’Phinney has just released an implementation of mustache for php5.3
Here is a pretty good introduction to it: http://blog.couch.io/post/622014913/mustache-js