Extending Prototype's Template class to allow default values

I’ve often wanted to extend Prototype’s Template class to allow setting default values for template fields if the user doesn’t pass them, so I wrote a simple wrapper class that does just that.

This allows you to create a javascript template, but gives you one extra parameter where you can define default values for anything not passed by the user to .evaluate();

Of course, you will need to include the prototype library for this to work.

comments powered by Disqus