-
Notifications
You must be signed in to change notification settings - Fork 4
mixin form.twig
Aleksey Ilyin edited this page May 6, 2022
·
5 revisions
Generates a Bootstrap compliant block <div data-input class="checkbox|radio|form-group" ...
{% include 'mixin/form.twig' with {
'label': 'Login',
'description': 'Username or email',
'message': 'Be careful',
'prefix': 'Before field',
'postfix': 'After field',
'type': 'text', // text|email|tel|number|checkbox|radio
'name': 'my-field-name',
'args': {
'method': 'post',
'style': 'color: red;',
'class': ['d-block', 'p-3'],
'data': {
'arg1': 'val1', 'arg2': ''
},
'option': {
'yes':'Yes', 'no':'No'
},
'placeholder': 'Enter text..',
'value': '8',
'step': 2,
'min': 0,
'max': 10,
'selected': 'yes',
'checked': false,
'disabled': false,
'readonly': true,
}
} %}Mixin works with any type of HTML5 field input, textarea, select.
Also received during use, the field will receive the value from the current POST or GET parameters, and also receive the has-error class in case the field is filled with an error.
Information
Usage
For developers