From a1f95d48b96f44b4300e01ce94364d9b6a470375 Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Thu, 12 Jan 2017 09:54:40 +0800 Subject: [PATCH] MDL-57368 templates: add example context to core_form/element-template --- .../core_form/element-template.mustache | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/theme/boost/templates/core_form/element-template.mustache b/theme/boost/templates/core_form/element-template.mustache index 1af0c25fd93..e51b1a1afec 100644 --- a/theme/boost/templates/core_form/element-template.mustache +++ b/theme/boost/templates/core_form/element-template.mustache @@ -1,3 +1,46 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template core_form/element-template + + Template for the form element wrapper template. + + Context variables required for this template: + * label + * required + * advanced + * helpbutton + * error + * element + * id + * name + + Example context (json): + { + "label": "Course full name", + "required": true, + "advanced": false, + "error": null, + "element": { + "id": "id_fullname", + "name": "fullname" + } + } +}}