Skip to content

Instantly share code, notes, and snippets.

@fearphage
Created September 13, 2012 16:53
Show Gist options
  • Save fearphage/3715766 to your computer and use it in GitHub Desktop.
Save fearphage/3715766 to your computer and use it in GitHub Desktop.
doT.js template example
{
"settings": {
"foo": "low"
,"bar": "high"
,"baz": "low"
}
}
{{##def.radiogroup:
<h2>{{= name}}</h2>
{{~['low', 'high'] :value}}
<input type="radio" name="{{= name }}" value="{{= value }}"{{? it.settings[name] == value }} checked="checked"{{?}}/>
{{~}}
#}}
{{##def.settings:
<h1>Settings</h1>
{{~Object.keys(it.settings) :name}}
{{#def.radiogroup}}
{{~}}
#}}
{{#def.settings}}
@fearphage
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment