Skip to content
Browse files

layout support

  • Loading branch information...
1 parent f9d461d commit fb7a4d07ea715d3037449ee22e53356329be7d92 @pauliusuza pauliusuza committed Mar 25, 2012
Showing with 9 additions and 8 deletions.
  1. +9 −8 lib/view.js
View
17 lib/view.js
@@ -57,19 +57,20 @@ var View = Class.create ({
* @param {Function} fn
* @api private
*/
-
- ,renderHelper: function(path, options) {
- this.engine(path, options, function(err, res) {
- return res;
- });
- }
-
+
,render: function(options, fn){
var self = this;
this.engine(this.path, options, function(err, res) {
- options.render = self.renderHelper;
+
+ options.render = function(path, options) {
+ self.engine(path, options, function(err, res) {
+ return res;
+ });
+ };
+
var layout = options.layout || self.defaultLayout;
var extension = options.engine || self.defaultEngine;
+
if(layout != false) {
options.body = res;
self.engine(options.settings.views+'/'+layout+'.'+extension, options, fn);

0 comments on commit fb7a4d0

Please sign in to comment.
Something went wrong with that request. Please try again.