diff --git a/lib/plugin.js b/lib/plugin.js index 7c1d595..c186481 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -38,10 +38,23 @@ function Plugin (obj, options) { that.viewEngine.setView(tag, viewFile); }; - this.getView = function(viewName, locals, fn) { - that.viewEngine.getView(viewName, locals, fn); + /** + * Get the path for viewName in this plugin. + **/ + this.getView = function(viewName) { + return that.viewEngine.getView(viewName); }; + /** + * Render the view for the given viewName with the specified options. The + * function is executed when complete with the following signature: + * fn(err, html); + **/ + this.render = function(viewName, options, fn) { + logger.log('trace', 'Called render in the plugin'); + that.viewEngine.render(viewName, options, fn); + } + this.get = function() { if (!_.isNull(that.baseDir) && !_.isNull(that.requireFile)) diff --git a/lib/plugin_registry.js b/lib/plugin_registry.js index a95ff74..fe74659 100644 --- a/lib/plugin_registry.js +++ b/lib/plugin_registry.js @@ -81,6 +81,5 @@ PluginRegistry.prototype.__proto__ = EventEmitter.prototype; module.exports = { registry: new PluginRegistry(), - Plugin: plugin, - Template: template + Plugin: plugin }; \ No newline at end of file