Exemplo n.º 1
0
 static {
   try {
     handlebars.registerHelper(
         "compare",
         new Helper<Object>() {
           @Override
           public CharSequence apply(Object context, Options options) throws IOException {
             if (options.params[0].equals(context == "last")) {
               return options.fn();
             } else {
               return options.inverse();
             }
           }
         });
     template = handlebars.compile("/com/fantasy/system/job/dicts");
   } catch (IOException e) {
     LOGGER.error(e.getMessage(), e);
   }
 }
Exemplo n.º 2
0
 @Override
 protected void configure(final Handlebars handlebars) {
   handlebars.registerHelper("dateFormat", StringHelpers.dateFormat);
 }