moodle/lib/form/templates/element-button-inline.mustache
Jake Dallimore 893ce4f7b2
MDL-78916 core_form: allow class overrides on button form element
This works the same as the customclassoverride on the submit element,
in that only the 'btn' class is hard coded in the template. Passing
$options['customclassoverride'] to the constructor allows calling code
to specify other classes to be added beside 'btn'. E.g. 'btn-primary'.
If no options array is passed, 'btn-secondary' is used (the existing
class used for button elements).
2023-09-13 17:37:06 +08:00

21 lines
746 B
Plaintext

{{< core_form/element-template-inline }}
{{$element}}
{{^element.frozen}}
<button
class="btn
{{^element.customclassoverride}}btn-secondary{{/element.customclassoverride}}
{{#element.customclassoverride}}{{.}}{{/element.customclassoverride}}"
name="{{element.name}}"
id="{{element.id}}"
type="button"
{{#error}}
autofocus aria-describedby="{{element.iderror}}"
{{/error}}
{{{element.attributes}}}
>
{{{element.value}}}
</button>
{{/element.frozen}}
{{/element}}
{{/ core_form/element-template-inline }}