- Require UserFrosting 5.1
- Update PHPUnit 10
- Update PHP & JS dependencies
- Added support for UserFrosting 5
- Data passed to forms can be mixed type, not only string. Data will still be casted to string.
- Merge #12 - Remove fa class to allow for FA v5 fas & fab - Thanks @phillmac
- Fixed issue where the value of an element whose name is using dot notation wouldn't be found in the corresponding multidimensional array.
- Form nows register element class, instead of using hardcoded string.
- Form has new
registerTypemethod to register new custom elements.getType(string $name)andgetTypes()can be used to get the class for a type (eg. 'text', 'select', etc.) abd a list of types.removeTypewill unregister a type. - Form still fallback to
Texttype if type is not found, but this can now be changed withgetDefaultTypeandsetDefaultType. - Form uses
RequestSchemaRepositoryinstead ofRequestSchemaInterface. - Stricter PHP7 type throughout.
- Renamed
BaseInputtoInput. Inputhas newsetValue,getElement,setElement,getName&setNamemethods.- Checkbox element now pass the value to non-binary checkbox.
FormGeneratorControlleruses strict typing.- Finished tests and fix tests namespace. 100% coverage!
- Added PHP-CS-Fixer, PHPStan, StyleCI configuration.
- Updated Travis setup.
- Added
successCallbackoption - Support for UserFrosting 4.2
- Added support for Repository
- Fix issue when setting data that is a collection
formSuccessandconfirmSuccessevents now include the request data as a second argument
- Fix icon in textarea macro
- Added
modal-largetemplate file.
- Fix issue with
binarycheckbox tests. - Fix Text input style when no icon is added
- Added
binaryoption for checkbox to disable UF binary checkbox system (bool; default true).
- Add necessary HTML to disable submit and cancel button in modal form.
- New
$form->setOptionsfunction to set options of a select element. Shortcut for usingsetInputArgumentandsetValue.
- Fix issue with error alert no displaying on confirmation dialog
- Initialize ufAlert if not already done
- Autofocus first form field when modal is displayed
- Refactored the javascript plugin
- Added new events
- Added new
redirectAfterSuccessboolean option
- Fix warning with select macro
- Fix issue with the select macro
- Renamed macro templates with the
*.html.twigextension
- Completely refactored how form fields are parsed, including how default value are defined. Each input type now defines it's own class for defining default values and transforming some input.
- Twig templates updated to reflect the new parser.
- Twig macros changed from
*.generate(name, value)to*.generate(input). Booltype changed tocheckbox.- Removed the
numberTwig template (Will use the text input one). - Added unit tests.
- Support for any attributes in the schema. For example, if you need to add a data attribute to a field, your schema would be:
"myField" : {
"form" : {
"type" : "text",
"label" : "My Field",
"icon" : "fa-pencil",
"data-something" : "blah"
}
}
- Updated for UserFrosting v4.1.x
The custom RequestSchema have been removed. Instead of building the form directly on the schema using $schema->initForm(), you now create a new Form using $form = new Form($schema) and go on from there. Handling complex schema can now be done using the new loader system from UF 4.1.
$schema->generateForm(); has also been changed to $form->generate();.
- Bug fixes
- Initial release