I'm having a problem passing things around in mustache java. Historically what we've had is things like:
{{</partials/form/_form}}
{{$formContents}}
{{</partials/form/_text}}
{{$field}}hours{{/field}}
{{$label}}Number of hours{{/label}}
{{$inputAttributes}}size="2"{{/inputAttributes}}
{{$inputClasses}}inline {{/inputClasses}}
{{//partials/form/_text}}
{{</partials/form/_submit}}
{{$field}}next{{/field}}
{{//partials/form/_submit}}
{{/formContents}}
{{//partials/form/_form}}
Which works fine - however, I now need to be able to track what labels were assigned against a field. I was hoping that $formContents would be evaluated at the
point the partial is called - but it seems it's evaluated at the point it's referenced in the partial.
I've also tried creating a function something along the lines of:
{{#formContents}}
{{</partials/form/_text}}
{{$field}}hours{{/field}}
{{$label}}Number of hours{{/label}}
{{$inputAttributes}}size="2"{{/inputAttributes}}
{{$inputClasses}}inline {{/inputClasses}}
{{//partials/form/_text}}
{{</partials/form/_submit}}
{{$field}}next{{/field}}
{{//partials/form/_submit}}
{{/formContents}}
{{>/partials/form/_form}}
which was a last ditch attempt to get this working but it seems that mustache will fail compilation whenever a partial is used inside a function?
Any help greatly appreciated!