Moodle 2.9 adds support for implementing renderers as mustache templates

In all the new features of Moodle 2.9,the theme designers will really love the support added for implementing renderers as Mustache – logic less templates.

As per the tracker issue MDL-49152, Moodle 2.9 has been fixed with the mustache support for templates which allows identical calling from php or javascript.

A template is an alternative to writing blocks of html directly in javascript / php by concatenating strings. The end result is the same, but templates have a number of advantages:

  • It is easier to see the final result of the template because the code for a template is very close to what the final HTML will look like
  • Because the templating language is intentionally limited, it is hard to introduce complex logic into a template. This make it far easier for a theme designer to override a template, without breaking the logic
  • Templates can be rendered from javascript. This allows ajax operations to re-render a portion of the page.

For more details, read the Moodle 2.9 release notes here:

For more details about Templates: &

Jaswinder Singh

Jaswinder Singh, passionate about using Moodle in improving the Indian Education System and reaching the students in far flung areas where still education seems to be a impossible prospect of life. He is the author of the popular Moodle Book "How to use Moodle 2.7". In October 2016, Jaswinder was elected as the Moodle User's Association Committee member - the first to make it from India.

Related Articles