2

Guys mustache try to do wonderfull thing but its not my case. Moodle is PHP however themes uss mustache now, but the code generated are things 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}}

I'd like to know how to debug variables, what is coming in this file, because know I need to change and add some functionalities.

Fredy31
  • 2,660
  • 6
  • 29
  • 54

1 Answers1

1

Well I sugest you to print it {{variable}} in view, this should display the value, you can verify if that is true opening {{#variable}} do something{{/variable}} and you have the else option {{^variable}} else something{{/variable}}

I sugest you read the documentation here https://mustache.github.io/

The best to you would be to debug variable in php before sending to view, but I thing this link as StackOverflow may help you How to see all available variables in handlebars template

André Gava
  • 270
  • 6
  • 16