Class ProcessHandlebarsHelper
- java.lang.Object
-
- com.terminalfour.publish.handlebars.helper.BaseHelper
-
- com.terminalfour.publish.handlebars.helper.utility.ProcessHandlebarsHelper
-
- All Implemented Interfaces:
com.github.jknack.handlebars.Helper<Object>
@Component public class ProcessHandlebarsHelper extends BaseHelper
The {{{process ...}}} handlebar helper allows the developer to supply an inline handlebars template for processing within the current evaluation context.Usage
The process handlebar helper allows the developer to supply an inline handlebars template for processing within the current evaluation context.
Example
{{{process (publish element="Handlebars Template")}}}
In the example above, a Handlebars Template is loaded directly from within a Content Item and it then processed in the current evaluation context as an inline handlebars template.
-
-
Constructor Summary
Constructors Constructor Description ProcessHandlebarsHelper(IHandlebarsAPI handlebarsApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
apply(Object context, com.github.jknack.handlebars.Options options)
Theapply
method is the main entry point for handlebars.java helpers.
-
-
-
Constructor Detail
-
ProcessHandlebarsHelper
@Autowired public ProcessHandlebarsHelper(IHandlebarsAPI handlebarsApi)
-
-
Method Detail
-
apply
public String apply(Object context, com.github.jknack.handlebars.Options options) throws IOException
Description copied from class:BaseHelper
Theapply
method is the main entry point for handlebars.java helpers.It is called internally by the handlebars.java engine when a matching handlebars.java expression is encountered.
- Specified by:
apply
in interfacecom.github.jknack.handlebars.Helper<Object>
- Specified by:
apply
in classBaseHelper
- Parameters:
context
- The currently executing context.options
- The options.- Returns:
- The generated output.
- Throws:
IOException
- If processing of the expressions fails.
-
-