@@ -317,7 +317,7 @@ members. This is particularly useful when iterating over lists.
|
|||||||
|
|
||||||
```java
|
```java
|
||||||
Mustache.compiler().compile("{{this}}").execute("hello"); // returns: hello
|
Mustache.compiler().compile("{{this}}").execute("hello"); // returns: hello
|
||||||
Mustache.compiler().compile("{{#names}}{{this}}{/names}}").execute(new Object() {
|
Mustache.compiler().compile("{{#names}}{{this}}{{/names}}").execute(new Object() {
|
||||||
List<String> names () { return Arrays.asList("Tom", "Dick", "Harry"); }
|
List<String> names () { return Arrays.asList("Tom", "Dick", "Harry"); }
|
||||||
});
|
});
|
||||||
// result: TomDickHarry
|
// result: TomDickHarry
|
||||||
@@ -327,7 +327,7 @@ Note that you can also use the special variable `.` to mean the same thing.
|
|||||||
|
|
||||||
```java
|
```java
|
||||||
Mustache.compiler().compile("{{.}}").execute("hello"); // returns: hello
|
Mustache.compiler().compile("{{.}}").execute("hello"); // returns: hello
|
||||||
Mustache.compiler().compile("{{#names}}{{.}}{/names}}").execute(new Object() {
|
Mustache.compiler().compile("{{#names}}{{.}}{{/names}}").execute(new Object() {
|
||||||
List<String> names () { return Arrays.asList("Tom", "Dick", "Harry"); }
|
List<String> names () { return Arrays.asList("Tom", "Dick", "Harry"); }
|
||||||
});
|
});
|
||||||
// result: TomDickHarry
|
// result: TomDickHarry
|
||||||
|
|||||||
Reference in New Issue
Block a user