nxus / templater

The template manager for Nxus applications
1 stars 0 forks source link

Provide a gather or event for adding to template args/context #9

Closed loppear closed 8 years ago

loppear commented 8 years ago

Use cases:

Possible syntax: app.get('templater').templateContext({extraArgs}, 'namespace-prefix') or app.get('templater').on('templateContext', (name, req) => { return {extraArgs} })

In either case, templater will need to do additional work to smartly merge the returned objects, likely including merging arrays. Will need to get req available to templater to handle the callback (users) case, or generally do these as afters and have router inject req to the event.