lib/view.js
function (view) {
    view.base = view.base || view.cwd || process.cwd();
    this.src = this.src || {};
    // ensure that `view` has `path` and `content` properties
    this.validate(view);

    this.options.orig = view.content;
    this.options.plural = this.collection.options.plural;
    this.options.viewType = this.options.viewType = [];
    this.options.handled = this.options.handled = [];

    this.contexts = view.contexts = {};
    this.locals = view.locals || {};
    this.data = view.data || {};
    mixins(this);

    // add non-emumerable properties
    this.defineOption('route', this.options.route);
    this.define('_callbacks', this._callbacks);

    if (view.stat) {
      utils.defineProp(view, 'history', view.history);
      utils.defineProp(view, '_contents', view._contents);
      utils.defineProp(view, 'stat', view.stat);
    }

    view.__proto__ = this;
    utils.defineProp(view, '_callbacks', view._callbacks);

    // handle `onLoad` middleware routes
    this.app.handleView('onLoad', view, view.locals);
    this.ctx('locals', view.locals);
    this.ctx('data', view.data);
  }
function (view) {
    view.base = view.base || view.cwd || process.cwd();
    this.src = this.src || {};
    // ensure that `view` has `path` and `content` properties
    this.validate(view);

    this.options.orig = view.content;
    this.options.plural = this.collection.options.plural;
    this.options.viewType = this.options.viewType = [];
    this.options.handled = this.options.handled = [];

    this.contexts = view.contexts = {};
    this.locals = view.locals || {};
    this.data = view.data || {};
    mixins(this);

    // add non-emumerable properties
    this.defineOption('route', this.options.route);
    this.define('_callbacks', this._callbacks);

    if (view.stat) {
      utils.defineProp(view, 'history', view.history);
      utils.defineProp(view, '_contents', view._contents);
      utils.defineProp(view, 'stat', view.stat);
    }

    view.__proto__ = this;
    utils.defineProp(view, '_callbacks', view._callbacks);

    // handle `onLoad` middleware routes
    this.app.handleView('onLoad', view, view.locals);
    this.ctx('locals', view.locals);
    this.ctx('data', view.data);
  }
function ( view ) { view . base = view . base || view . cwd || process . cwd ( ) ; this . src = this . src || { } ; // ensure that `view` has `path` and `content` properties this . validate ( view ) ; this . options . orig = view . content ; this . options . plural = this . collection . options . plural ; this . options . viewType = this . options . viewType = [ ] ; this . options . handled = this . options . handled = [ ] ; this . contexts = view . contexts = { } ; this . locals = view . locals || { } ; this . data = view . data || { } ; mixins ( this ) ; // add non-emumerable properties this . defineOption ( 'route' , this . options . route ) ; this . define ( '_callbacks' , this . _callbacks ) ; if ( view . stat ) { utils . defineProp ( view , 'history' , view . history ) ; utils . defineProp ( view , '_contents' , view . _contents ) ; utils . defineProp ( view , 'stat' , view . stat ) ; } view . __proto__ = this ; utils . defineProp ( view , '_callbacks' , view . _callbacks ) ; // handle `onLoad` middleware routes this . app . handleView ( 'onLoad' , view , view . locals ) ; this . ctx ( 'locals' , view . locals ) ; this . ctx ( 'data' , view . data ) ; }
Initialize view with base properties.
Initialize view with base properties .