Class WithHelper

java.lang.Object
com.github.jknack.handlebars.helper.WithHelper
All Implemented Interfaces:
Helper<Object>

public class WithHelper extends Object implements Helper<Object>

Normally, Handlebars templates are evaluated against the context passed into the compiled method.

You can shift the context for a section of a template by using the built-in with block helper.

Since:
0.3.0
  • Field Details

  • Constructor Details

    • WithHelper

      public WithHelper()
  • Method Details

    • apply

      public Object apply(Object context, Options options) throws IOException
      Description copied from interface: Helper
      Apply the helper to the context.
      Specified by:
      apply in interface Helper<Object>
      Parameters:
      context - The context object.
      options - The options object.
      Returns:
      A string result.
      Throws:
      IOException - If a template cannot be loaded.