public interface NamedHelper<T>
extends com.github.jknack.handlebars.Helper<T>
Example usage: (Java DSL)
import ratpack.handlebars.NamedHelper; import com.github.jknack.handlebars.Options; import ratpack.handling.*; import ratpack.guice.*; import ratpack.func.Action; import ratpack.launch.*; public class MultiplyHelper implements NamedHelper<String> { public String getName() { return "hello"; } CharSequence apply(String context, Options options) throws IOException { return String.format("Hello %s", context) } } class ModuleBootstrap implements Action<BindingsSpec> { public void execute(BindingsSpec bindings) { bindings.bind(MultiplyHelper.class) } } LaunchConfig launchConfig = LaunchConfigBuilder.baseDir(new File("appRoot")) .build(new HandlerFactory() { public Handler create(LaunchConfig launchConfig) { return Guice.handler(launchConfig, new ModuleBootstrap(), new Action<Chain>() { public void execute(Chain chain) { } }); } });Example usage: (Groovy DSL)
bindings { bind MultiplyHelper }
String getName()