File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55This library provides various helpers for adding logic to [ Handlebars.java] ( https://github.com/jknack/handlebars.java ) .
66Most of them are basic helpers that can be used as subexpressions in the built-in block helpers of Handlebars.java.
7- This allows writing the templates in a fluent way.
7+ This allows writing the template logic in a fluent way.
88
99** Example**
1010
1111Given the following YAML model:
12- ``` yaml
12+ ```
1313birthYear: 1997
1414```
1515and the following template:
1616
17- ` ` ` hbs
17+ ```
1818{{def 'fifteenYear' (math birthYear '+' 15)}}
1919{{#ifb (or
20- (and
20+ (and
2121 (compare (math fifteenYear '%' 4) '==' 0)
2222 (compare (math fifteenYear '%' 100) '!=' 0)
23- )
24- (compare (math fifteenYear '%' 400) '==' 0)
23+ )
24+ (compare (math fifteenYear '%' 400) '==' 0)
2525 )
2626}}
2727Your fifteenth anniversary was in a leap year!
You can’t perform that action at this time.
0 commit comments