All notable changes to this project will be documented in this file.
- Added hCaptcha support. You can now use either Google Recaptcha or hCaptcha by passing the appropriate captcha object
to the
captcha
option in the field configuration. See the hCaptcha example for more info.
-
Refactored all jQuery code to vanilla JavaScript/TypeScript. jQuery is no longer required.
-
Collections are now initialized with a data attribute containing json config set within PHP code. This means that the collection type can now be initialized without any JavaScript. See the collection docs for more info
-
The JavaScript/Typescript code is now published as an NPM module and can be imported into your project. See the Vite, Webpack and other bundlers docs for more info. You can also use the unpkg CDN to get the full pacakge:
<script src="https://unpkg.com/@palmtree/[email protected]/dist/palmtree-form.pkgd.min.js"></script>
- Updated UMD in JS code for Vite support. In Vite production builds,
module.exports
is defined butrequire
is not. This change checks thatrequire
is defined as a function before using it.
- Bumped the minimum required PHP version to 8.1
-
Added the ability to set form (help) text for form controls, e.g.:
$form->add('email', EmailType::class, [ 'help' => "We'll never share your email with anyone." ]);
- Bug fix: Fixed data binding not working for collection types (#13)
- Bug fix: Allow passing both shorthand types e.g.
text
to AbstractType::add() - DX: Generic typing in TypeLocator
- Bug fix: The
required
attribute is now correctly omitted on a select field if therequired
option is set tofalse
in theChoiceType
configuration (#9)
- Added data binding to map form data to an object or an array. Read the docs page for more information
- Bug fix: Allow
CollectionType
entry types to be scalar. Previously, the entry type data was required to be an array which threw a fatal error if the data was a string for example. (#7)
- Added
renderRest
method to render all remaining unrendered fields.
Added functionality to render fields individually with a new renderField
method. Among other things, this allows
developers to fully utilise Bootstrap's grid system by rendering fields in different columns.
Added support for Bootstrap 5. This was achieved by:
- Adding the
mb-3
class alongsideform-group
to div wrappers - Adding the
form-label
class to form labels