forked from ApacheExpress/ApacheExpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelloWorld.mustache
53 lines (45 loc) · 984 Bytes
/
HelloWorld.mustache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{{> header}}
<p>
This is a demo for the Mustache handler written via mod_swift.
The data comes from a Swift dictionary which looks like this:
</p>
<pre class="zzsource">
let sampleDict : [ String : Any ] = [
"name" : "Chris",
"value" : 10000,
"taxed_value" : Int(10000 - (10000 * 0.4)),
"in_ca" : true,
"addresses" : [
[ "city" : "Cupertino" ],
[ "city" : "Mountain View" ]
]
]
</pre>
<p>... and renders into this:</p>
<div style="padding: 1em; border: 1px dotted #AAA;">
<p>
Hello {{name}}!
</p>
<p>
You have just won {{& value}} dollars!
{{#in_ca}}
Well, {{{taxed_value}}} dollars, after taxes.
{{/in_ca}}
</p>
<p>
{{#addresses}}
<li>Has address in: {{city}}</li>
{{/addresses}}
{{^addresses}}
Has NO addresses
{{/addresses}}
</p>
</div>
<p>
Here is the template location and source:
</p>
<pre class="zzsource">
{{filename}}
{{template}}
</pre>
{{> footer}}