yui/yui3 — pull request #1026 by clarle (2013-07-24 17:29:33+00:00)
Title: Template registration, first implementation (now in dev-3.x)

As discussed in #1021 and the linked gist.

Here's a first drop for template registration, including full tests, user guide documentation, and API docs.

@ericf and I were discussing a possible addition to the `Y.Template.register` API, where it would also accept a hash of template names to template functions. For example:

```js
// Registers 'foo', 'bar', and 'baz' templates all at once
Y.Template.register({
'foo': fooTemplate,
'bar': barTemplate,
'baz': bazTemplate
});
```

I started implementing something like this, but I wasn't sure what `Y.Template.register(templateHash)` would return. The current `Y.Template.register(templateName, template)` returns the revived template to maintain compatibility with the `revive()` API.

Pinging @caridy also for review.