When I look in the dojo documentation for template all I get is for dijit and examples only show you been able to use them in a widgit. I’m looking for the equivalent of the below methods in js prototype
var tmpl = new Template(url)
tmpl.evaluate(templateObj)
Does dojo have a template method that you can use in a dojo.declare( class ){} like you can do in js prototype. If not how could I go about similar functionality
Thanks
You may be interested in
dojo.string.substitute(you’ll need todojo.require("dojo.string")).http://dojotoolkit.org/api/dojo/string/substitute
[Edit] Also, if you’re interested in acquiring a template for use in substitution from a URL on the same server, you may also want to look into
dojo.cache(which is also what is often used to fetch widget templates):http://dojotoolkit.org/reference-guide/dojo/cache.html
To clarify missingno’s response, I don’t think
dojo.parseris what you’re interested in right now; its job is to scan the DOM and transform DOM nodes into widgets and other Dojo components.dijit._Templatedonly usesdojo.parserwhen child widgets are involved (i.e.widgetsInTemplateistrue); on the other hand, it usesdojo.string.substitutein all cases, to initially parse${...}strings (e.g.${id}) in the template.