vendredi 28 août 2009

Simple mootools templating

Mootools has a simple yet powerful templating system. Before I knew it, dealing with html was a kind of nightmare because the layout was not separated from the data logic.

now I use abuse of this.

here is a quick overview of what can be done with templating

var example = 'My name is {name}. I love {passion}';

var obj = { name: 'Sean', passion: 'programming' };
var subbed = example.substitute(obj);
alert(subbed); //My name is Sean. I love programming';

read the full post

Aucun commentaire:

Enregistrer un commentaire