Skip to content

Template registration, first implementation #1025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Template registration, first implementation #1025

wants to merge 3 commits into from

Conversation

clarle
Copy link
Collaborator

@clarle clarle commented Jul 24, 2013

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:

// 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.

@clarle
Copy link
Collaborator Author

clarle commented Jul 24, 2013

I'm an idiot and PR'd into master again.

@clarle clarle closed this Jul 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant