Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-50166

Add a way to pass arguments to mustache helpers (php and js)

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 2.9
    • Themes
    • MOODLE_29_STABLE
    • MDL-50166-master
    • Hide

      Checkout each of the branches mentioned below - run the unit tests for each of the projects (mustache.php and mustache.js).

      Checkout this branch - view the template library - make sure all existing templates still work.

      (There will be more issues blocked by this that verify the new behaviour).

      Show
      Checkout each of the branches mentioned below - run the unit tests for each of the projects (mustache.php and mustache.js). Checkout this branch - view the template library - make sure all existing templates still work. (There will be more issues blocked by this that verify the new behaviour).

      right now - a helper will only receive the block of text from a section.

      Handlebars, (and others) allow helpers to receive arguments - e.g.

      str error filenotfound
      vs
      #str}}error filenotfound{{/str

      if we want to implement a conditional helper it will require this
      e.g.
      #if contextvara "eq" "5"
      /if

      This allows us to have presentation logic in the templates, which will make the templates more re-usable.

            damyon Damyon Wiese
            damyon Damyon Wiese
            Ryan Wyllie Ryan Wyllie
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.