, 08 2010 . 07:22
+
- frameworks, php- RoR TPP. , - " ", , (XSLT) ... - , , - , / .
, js:
function magicProcess(template, data) {
for(var b=template,c=data,d=/:[a-zA-Z][a-zA-Z0-9\-_]+/g,e,f=b,g=0;e=d.exec(b);) {
var h=e[0].replace(/^:/,"");
if(c[h]!=null) {
f=f.replace(e[0],c[h]);
g++;
} else f=f.replace(e[0]," ")
}
if(g==0)f="";
return f;
}
, 1278 , 299. , 299 - , ... , , , , .
? , , , , ... .