Skip to content

Commit

Permalink
Updates from the ghiraldi-views-engine work.
Browse files Browse the repository at this point in the history
  • Loading branch information
sax1johno committed May 9, 2013
1 parent 5c1d1c0 commit 4e22fc0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
17 changes: 15 additions & 2 deletions lib/plugin.js
Expand Up @@ -38,10 +38,23 @@ function Plugin (obj, options) {
that.viewEngine.setView(tag, viewFile); 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() { this.get = function() {
if (!_.isNull(that.baseDir) if (!_.isNull(that.baseDir)
&& !_.isNull(that.requireFile)) && !_.isNull(that.requireFile))
Expand Down
3 changes: 1 addition & 2 deletions lib/plugin_registry.js
Expand Up @@ -81,6 +81,5 @@ PluginRegistry.prototype.__proto__ = EventEmitter.prototype;


module.exports = { module.exports = {
registry: new PluginRegistry(), registry: new PluginRegistry(),
Plugin: plugin, Plugin: plugin
Template: template
}; };

0 comments on commit 4e22fc0

Please sign in to comment.