Class BlockHelper

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

public class BlockHelper extends Object implements Helper<Object>

The block helper will replace its section with the partial of the same name if it exists.

If delete-after-merge is set to true, the partial will be delete once applied it.

  {{block "title" [delete-after-merge=false]}}
 
Since:
0.3.0
  • Field Details

  • Constructor Details

    • BlockHelper

      public BlockHelper()
  • 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.