marionettejs/backbone.marionette — pull request #1473 by pklingem (2014-06-11 04:51:53+00:00)
Title: add renderOptions to ItemView rendering

Adds the ability for developers to define a `renderOptions` property on `ItemView`s (and subclasses) which will be passed to `Marionette.Renderer.render`. In this way, custom implementations of `Marionette.Renderer.render` can be called with properties that are not considered template data.

A couple of use cases:

1. choosing a rendering engine on a per view basis, e.g.:

{ renderOptions: { engine: 'mustache' } }

2. specifying mustache partials, e.g.:

{ renderOptions: { partials: { todo: todoPartial } } }

etc.

Another option to make ItemView rendering more flexible, is to call the `Renderer.render` function from the `ItemView.render` function with `this` bound to the `ItemView` instance, e.g.:

Marionette.Renderer.render.call(this, template, data)

as opposed to:

Marionette.Renderer.render(template, data)

but this may be undesirable.