Dear All,
I’m writing a gradebook report plugin (under grade/report/myreport) and I have a question concerning the page layout. Most of the code that render tables in Moodle 3 seems to use the html_table() object to output HTML content. From reading this page, it seems Mustache templates are the way to go from now on:
https://docs.moodle.org/dev/Templates
Is that right?
Assuming so, I created a template under grade/report/myreport/templates/main.mustache and called it using the following:
$OUTPUT->render_from_template("grade/report/myreport/main", $context);
But I get the following error:
Templates cannot be placed in sub directories
Does that mean that my template must be installed directly under grade/templates? (Which does not exist in my Moodle 3.0 installation.) It feels wrong to put the template outside my plugin directory so I wanted to ask others what they do in that situation. I can still fall back to using an html_table object in my plugin but if it’s going to disappear, I guess I should not.
Regards,
Laurent