Threshing variables in mustache

Asked

Viewed 54 times

1

People the mustache promises to do wonders but it’s not my case. The Moodle is PHP but the themes now use mustache, but the screen code generated by the mustache is something like this:

<nav class="list-group m-t-1">
{{/showdivider}}
{{#action}}
<a class="list-group-item list-group-item-action {{#isactive}}font-weight-bold{{/isactive}}" href="{{{action}}}" data-key="{{key}}">
    <div class="m-l-{{get_indent}}">
        {{#is_section}}
            <div class="media">
                <span class="media-left">
                    {{#pix}}i/folder{{/pix}}
                </span>
                <span class="media-body">{{{text}}}</span>
            </div>
        {{/is_section}}
        {{^is_section}}
            {{{text}}}
        {{/is_section}}
    </div>
</a>
{{/action}}
{{^action}}
<div class="list-group-item" data-key="{{key}}">
    <div class="m-l-{{get_indent}}">
        {{#is_section}}
            {{#pix}}i/folder{{/pix}}
        {{/is_section}}
        {{{text}}}
    </div>
</div>
{{/action}}

{{/ flatnavigation }}

I want to know how to debug the variables, what is coming in this file, why now I need to change and add features and I "think" I’m sending right, but it’s really like taking a shot in the dark. I’ve tried google but mustache not found much to help me, someone knows something?

  • Already tried debugging in PHP and check the return that is sent to view?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.