mirror of
https://github.com/thinkjs/thinkjs.git
synced 2026-01-25 14:42:47 +00:00
32 lines
946 B
JavaScript
32 lines
946 B
JavaScript
var view = module.exports = Class(function(){
|
|
return {
|
|
tVar: {},
|
|
init: function(){
|
|
this.tVar = {};
|
|
},
|
|
assign: function(name, value){
|
|
if (is_object(name)) {
|
|
this.tVar = extend(this.tVar, name);
|
|
}else{
|
|
this.tVar[name] = value;
|
|
}
|
|
},
|
|
get: function(name){
|
|
if (!name) {
|
|
return this.tVar;
|
|
};
|
|
return this.tVar[name];
|
|
},
|
|
display: function(templateFile, charset, conentType, content, prefix){
|
|
tag("view_begin");
|
|
content = this.fetch(templateFile, content, prefix);
|
|
this.render(content, charset, contentType);
|
|
tag("view_end");
|
|
},
|
|
render: function(conent, charset, contentType){
|
|
if (charset === undefined) {
|
|
charset = C('encoding');
|
|
};
|
|
}
|
|
}
|
|
}) |