Class 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 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
        The apply 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 interface com.github.jknack.handlebars.Helper<Object>
        Specified by:
        apply in class BaseHelper
        Parameters:
        context - The currently executing context.
        options - The options.
        Returns:
        The generated output.
        Throws:
        IOException - If processing of the expressions fails.