Permalink
Browse files

Updates from the ghiraldi-views-engine work.

  • Loading branch information...
1 parent 5c1d1c0 commit 4e22fc00f95a9dc197db92bce982458857d18649 @sax1johno committed May 9, 2013
Showing with 16 additions and 4 deletions.
  1. +15 −2 lib/plugin.js
  2. +1 −2 lib/plugin_registry.js
View
@@ -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))
@@ -81,6 +81,5 @@ PluginRegistry.prototype.__proto__ = EventEmitter.prototype;
module.exports = {
registry: new PluginRegistry(),
- Plugin: plugin,
- Template: template
+ Plugin: plugin
};

0 comments on commit 4e22fc0

Please sign in to comment.