1234567891011121314151617181920212223242526 |
- /**
- * Created by benzhan on 15/8/13.
- */
- var prototype = Controller.prototype;
- function Controller() {
- }
- var data = {};
- prototype.assign = function(key, value) {
- if (typeof key == 'object') {
- for (var k in key) {
- data[k] = key[k];
- }
- } else {
- data[key] = value;
- }
- };
- prototype.display = function(tpl) {
- tpl = tpl || CONTROLLER_NAME + '/' + ACTION_NAME;
- _res.render(tpl, data);
- }
- module.exports = Controller;
|