helperOptions

  • typedef
can.Mustache.helperOptions

{Object}

 

The options argument passed to a helper function.

Object

Properties

  1. fn {function(context)}Optional

    Provided if a section helper is called. Call fn to render the BLOCK with the specified context.

    • context {*}
  2. inverse {function(context)}Optional

    Provided if a section helper is called with {{else}}. Call inverse to render the INVERSE with the specified context.

    • context {*}
  3. hash {Object<String,* | String | Number>}

    An object containing all of the final arguments listed as name=value pairs for the helper.

    {{helper arg1 arg2 name=value other=3 position="top"}}
    
    options.hash = {
        name: <context_lookup>.value,
        other: 3,
        position: "top"
    }
    
  4. contexts {Array}

    An array containing the context lookup stack for the current helper.

    {{#section}}
        {{#someObj}}
            {{#panels}}
                {{helper}}
            {{/panels}}
        {{/someObj}}
    {{/section}}
    
    options.contexts = [
        <root_scope>,
        <context_lookup>.section,
        <context_lookup>.someObj,
        panel
    ]