Class FormHandlebarsHelper
- java.lang.Object
-
- com.terminalfour.publish.handlebars.helper.BaseHelper
-
- com.terminalfour.publish.handlebars.helper.form.FormHandlebarsHelper
-
- All Implemented Interfaces:
com.github.jknack.handlebars.Helper<Object>
@Component public class FormHandlebarsHelper extends BaseHelper
The {{form ...}} handlebars helper is used to publish forms.Usage
The {{form ...}} handlebars helper is a simple helper to allow forms to be published.
Attributes
- id - The id attribute is required and must be set to the id of the Form to be processed.
- use-iframe - The optional use-iframe attribute can be used to generate an IFrame instead of embedding the form directly in the page. An iframe will only be used if the value of this attribute is true.
Example
{{form id="11"}}
In the above example, the Form with id 11 should be published.
-
-
Constructor Summary
Constructors Constructor Description FormHandlebarsHelper(IFormAPI formApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CharSequence
apply(Object context, com.github.jknack.handlebars.Options options)
Theapply
method is the main entry point for handlebars.java helpers.
-
-
-
Constructor Detail
-
FormHandlebarsHelper
@Autowired public FormHandlebarsHelper(IFormAPI formApi)
-
-
Method Detail
-
apply
public CharSequence 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.
-
-