What problem does it solve?
This Skill streamlines the creation, validation, and submission of forms within Drupal, addressing the complexity of handling user input and configuration settings.
Core Features & Use Cases
- Form Lifecycle Management: Implement
buildForm, validateForm, and submitForm for custom forms.
- Configuration Forms: Utilize
ConfigFormBase for managing module settings with schema validation.
- Confirmation Forms: Employ
ConfirmFormBase for destructive actions with clear user confirmation.
- Form Altering: Modify existing forms using
hook_form_alter and hook_form_FORM_ID_alter.
- AJAX Forms: Implement dynamic form elements with server-side callbacks for enhanced user experience.
- Use Case: Create an administrative settings page for a custom module, including input validation and saving configuration to Drupal's config system.
Quick Start
Use the drupal-forms-api skill to create a new Drupal form with a textfield and a submit button.