Class HandlebarsHelperRegistrationUtils
java.lang.Object
org.onehippo.forge.templating.support.handlebars.util.HandlebarsHelperRegistrationUtils
Utility to register helper functions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.github.jknack.handlebars.Handlebars
registerHelpers
(com.github.jknack.handlebars.Handlebars handlebars, String prefix, Class<?> helperClazz, Object helperSource) Register all the declared methods ofhelperClazz
as helpers with prefixing the helper names byprefix
if a non-null string is provided.static com.github.jknack.handlebars.Handlebars
registerHelpers
(com.github.jknack.handlebars.Handlebars handlebars, String prefix, Object helperSource) Register all the declared methods ofhelperClazz
as helpers with prefixing the helper names byprefix
if a non-null string is provided.
-
Method Details
-
registerHelpers
public static com.github.jknack.handlebars.Handlebars registerHelpers(com.github.jknack.handlebars.Handlebars handlebars, String prefix, Object helperSource) Register all the declared methods ofhelperClazz
as helpers with prefixing the helper names byprefix
if a non-null string is provided.- Parameters:
handlebars
- handlebarsprefix
- prefixhelperSource
- helperSource- Returns:
- handlebars
-
registerHelpers
public static com.github.jknack.handlebars.Handlebars registerHelpers(com.github.jknack.handlebars.Handlebars handlebars, String prefix, Class<?> helperClazz, Object helperSource) Register all the declared methods ofhelperClazz
as helpers with prefixing the helper names byprefix
if a non-null string is provided.- Parameters:
handlebars
- handlebarsprefix
- prefixhelperClazz
- helperClazzhelperSource
- helperSource- Returns:
- handlebars
-