Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
doc
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

License Build Status

Handlebars.java Helpers

This library provides various helpers for adding logic to Handlebars.java. Most of them are basic helpers that can be used as subexpressions in the built-in block helpers of Handlebars.java. This allows writing the template logic in a fluent way.

Example

Given the following YAML model:

birthYear: 1997

and the following template:

{{def 'fifteenYear' (math birthYear '+' 15)}}
{{#ifb (or
          (and
            (compare (math fifteenYear '%' 4) '==' 0)
            (compare (math fifteenYear '%' 100) '!=' 0)
          )
          (compare (math fifteenYear '%' 400) '==' 0)
       )
}}
Your fifteenth anniversary was in a leap year!
{{else}}
Your fifteenth anniversary was in a non-leap year!
{{/ifb}}

The resulting text will be:

Your fifteenth anniversary was in a leap year!

Please read the documentation before using the handlebars-java-helpers library.

You can’t perform that action at this time.