Object
When a helper function
is called by a Helper Expression, a helperOptions
object is passed with the following properties:
stache.registerHelper( "myHelper", function( helperOptions ) {
helperOptions.fn; //-> sectionRenderer(){}
helperOptions.inverse; //-> sectionRenderer(){}
helperOptions.hash; //-> Object
helperOptions.context; //-> *
helperOptions.scope; //-> Scope
helperOptions.option; //-> Scope.Options
} );
Options
-
fn
{sectionRenderer(context, helpers)}:
Renders the "truthy" subsection
BLOCK. options.fn is only available if the helper is called as a
{{#expression}} or {{^expression}}. Read about
section renderer for more information.
-
inverse
{sectionRenderer(context, helpers)}:
Renders the "falsey" subsection
INVERSE. options.inverse is only available if the helper is called as a
{{#expression}} or {{^expression}} and {{else}}
is used. Read about
section renderer for more information.
-
hash
{Object}:
An object containing all of the
Hash expression keys and values. For example:
{{helper arg1 arg2 name=value other=3 position="top"}}
might provide a hash like:
{
name: compute( "Mr. Pig" ),
other: 3,
position: "top"
}
-
context
{*}:
The current context the stache helper is called within. Read
Scope and Context for more information.
-
scope
{can-view-scope}:
An object that represents the current context and all parent
contexts. It can be used to look up key values in the current scope.
Read Scope and Context and can-view-scope for more information.
-
options
{can-view-scope.Options}:
It can be used to look up key values in the current options scope.
Read Scope and Context and [can-view-scope.Options] for more information.