开发者

textual substitution in an html template by ${varName} notation

开发者 https://www.devze.com 2023-02-07 05:45 出处:网络
so I was looking at a project and I noted that they had a templating system set up in html files, and I am not too familiar with the whole concept...But when I started browsing the code I was seeing t

so I was looking at a project and I noted that they had a templating system set up in html files, and I am not too familiar with the whole concept...But when I started browsing the code I was seeing things like: ${varName} which upon execution were being substituted for names out of an nls file which I assume is intended t开发者_C百科o allow for multiple languages.

I know for a fact that the templating file does not get parsed by a php engine, so I am thinking that maybe the syntax is some type of shorthand for server-side javascript. Which has me intrigued, does anyone have any ideas as to how they are accomplishing this substitution? I cant seem to find info on this in any google search I could think of, so any hints would be helpful.


If you are looking at code which extends dijit._Templated and references a file or an inline string with this syntax, it's being parsed client side. The references are variable names on the widget JS object, which can be set up to point at strings from a localized string bundle with dojo.i18n

0

精彩评论

暂无评论...
验证码 换一张
取 消