Class EmbeddedHelper
- java.lang.Object
-
- com.github.jknack.handlebars.helper.EmbeddedHelper
-
- All Implemented Interfaces:
Helper<java.lang.String>
public class EmbeddedHelper extends java.lang.Object implements Helper<java.lang.String>
Given: home.hbs<html> ... {{emdedded "user" ["id"]}} </html>
where user.hbs is:<tr> <td>{{firstName}}</td> <td>{{lastName}}</td> </tr>
expected output is:<script id="user-hbs" type="text/x-handlebars-template"> <tr> <td>{{firstName}}</td> <td>{{lastName}}</td> </tr> </script>
Optionally, a user can set the template's name:{{emdedded "user" "user-tmpl" }}
expected output is:<script id="user-tmpl" type="text/x-handlebars-template"> <tr> <td>{{firstName}}</td> <td>{{lastName}}</td> </tr> </script>
- Since:
- 0.3.0
-
-
Constructor Summary
Constructors Constructor Description EmbeddedHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
apply(java.lang.String path, Options options)
Apply the helper to the context.
-
-
-
Field Detail
-
INSTANCE
public static final Helper<java.lang.String> INSTANCE
A singleton instance of this helper.
-
NAME
public static final java.lang.String NAME
The helper's name.- See Also:
- Constant Field Values
-
-