yiggle / form-wizard-bundle
Sulu 3 Form Wizard
Package info
github.com/Predjee/form-wizard-bundle
Type:symfony-bundle
pkg:composer/yiggle/form-wizard-bundle
Requires
- php: ^8.4
- doctrine/doctrine-bundle: ^2.13
- doctrine/orm: ^2.20 || ^3.0
- phpdocumentor/type-resolver: ^1.7 || ^2.0
- phpstan/phpdoc-parser: ^2.3
- sulu/sulu: ^3.0
- symfony/form: ^7.4 || ^8.0
- symfony/framework-bundle: ^7.4 || ^8.0
- symfony/mailer: ^7.4 || ^8.0
- symfony/mime: ^7.4 || ^8.0
- symfony/security-csrf: ^7.4 || ^8.0
- symfony/stimulus-bundle: ^2.32
- symfony/translation: ^7.4 || ^8.0
- symfony/twig-bundle: ^7.4 || ^8.0
- symfony/ux-turbo: ^2.32
- symfony/validator: ^7.4 || ^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.70
- mollie/mollie-api-php: ^3.9
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.0
- phpstan/phpstan-doctrine: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^12
- rector/rector: ^2.0
- symfony/browser-kit: ^7.4 || ^8.0
- symfony/dotenv: ^7.4 || ^8.0
- symfony/phpunit-bridge: ^8.0
- symplify/easy-coding-standard: ^12.5
Suggests
- mollie/mollie-api-php: Optional: required only if you use the Mollie payment integration.
- symfony/asset-mapper: Optional: required to use the bundle's CSS stylesheet.
README
Concept
The bundle implements a content-driven form workflow engine.
A wizard consists of:
Wizard → Steps → Fields → Submission
Optionally a wizard may include:
- Payment handling
- Notifications
- Export integrations
The runtime flow is powered by Symfony Form Flow while the configuration is managed via Sulu Admin blocks.
A Sulu 3 bundle that provides a configurable multi-step form wizard with:
- Sulu Admin configuration (forms, steps, fields, receivers)
- Website rendering via a wizard controller + Symfony Forms
- Optional payment provider integration (e.g. Mollie)
- Email notifications (admin and customer)
- Export of submissions
Status: pre-1.0. The public API is intended to be stable, but namespaces and extension points may still evolve.
Compatibility
| Component | Supported |
|---|---|
| PHP | 8.4+ |
| Symfony | 7.4 / 8.x |
| Sulu | 3.x |
| Doctrine ORM | 2.20+ / 3.x |
Installation
1. Enable the Yiggle recipe repository
The bundle ships its Symfony Flex recipes in a custom repository.
composer config --no-plugins --json extra.symfony.endpoint \
'["https://api.github.com/repos/Predjee/symfony-recipes/contents/index.json?ref=main","flex://defaults"]'
2. Install the bundle
composer require yiggle/form-wizard-bundle
The Flex recipe will automatically install:
- Routes
- Default configuration
- Post-install instructions
Database
The bundle ships Doctrine entities and expects your project to manage migrations.
php bin/console doctrine:migrations:diff php bin/console doctrine:migrations:migrate
Sulu Admin Integration
The bundle provides a Sulu admin module to manage:
- Wizards (forms)
- Steps
- Fields
- Email receivers
- Submissions export
Import the bundle's admin JavaScript in assets/admin/app.js:
import '@yiggle-form-wizard/admin/index.js';
Add the alias to your admin webpack config (assets/admin/webpack.config.js):
config.resolve.alias = { ...config.resolve.alias, '@yiggle-form-wizard': path.resolve(__dirname, '..', '..', 'vendor', 'yiggle', 'form-wizard-bundle', 'assets'), };
Rebuild the Sulu admin interface:
php bin/console sulu:admin:update-build
Note: The admin build output (
public/build/admin) should be committed to your repository. Answernwhen prompted to overwritewebpack.config.jsandpackage.jsonduring the build.
Frontend Assets
The bundle ships optional frontend helpers.
CSS
An optional stylesheet is available:
import '@yiggle-form-wizard/styles/form_wizard.css';
Import it in your frontend build (Webpack, Vite, AssetMapper, etc.).
Stimulus controller (optional)
For AJAX-based wizard flows using Turbo.
Requires:
composer require symfony/stimulus-bundle symfony/ux-turbo
Enable the controller in your assets/controllers.json:
{
"controllers": {
"@yiggle/form-wizard-bundle": {
"receipt-trigger": {
"enabled": true
}
}
}
}
Configuration
# config/packages/yiggle_form_wizard.yaml yiggle_form_wizard: notifiers: email: default_from_email: '%env(default::YIGGLE_FORM_WIZARD_DEFAULT_FROM_EMAIL)%' default_from_name: '%env(default::YIGGLE_FORM_WIZARD_DEFAULT_FROM_NAME)%' payment: mollie: enabled: '%env(bool:default::YIGGLE_FORM_WIZARD_MOLLIE_ENABLED)%' api_key: '%env(default::YIGGLE_FORM_WIZARD_MOLLIE_API_KEY)%' webhook_url_base: '%env(default::YIGGLE_FORM_WIZARD_MOLLIE_WEBHOOK_URL_BASE)%'
Optional environment variables:
YIGGLE_FORM_WIZARD_DEFAULT_FROM_EMAIL
YIGGLE_FORM_WIZARD_DEFAULT_FROM_NAME
YIGGLE_FORM_WIZARD_MOLLIE_ENABLED
YIGGLE_FORM_WIZARD_MOLLIE_API_KEY
YIGGLE_FORM_WIZARD_MOLLIE_WEBHOOK_URL_BASE
Extension Points
The bundle is designed to be extensible without modifying core code. See docs/extension-points.md for full documentation.
Field Types
#[AsWizardFieldType] final class MyFieldTypeHandler implements WizardFieldTypeHandlerInterface { public function getKey(): string { return 'my_type'; } public function buildForm(FormBuilderInterface $builder, array $options): void { // Build Symfony form field } }
Payment Providers
#[AsPaymentProvider(alias: 'acme')] final class AcmeProvider implements PaymentProviderInterface { public function getAlias(): string { return 'acme'; } public function startPayment(WizardSubmission $submission): ?string { // return checkout URL } public function fetchStatus(string $transactionId): PaymentStatus { // query provider } }
Notifications
#[AutoconfigureTag('yiggle_form_wizard.wizard_notifier')] final class MyNotifier implements WizardNotifierInterface { }
Events
The bundle dispatches Symfony events throughout the wizard lifecycle. See docs/payment-lifecycle.md for the full flow.
| Event | Description |
|---|---|
WizardSubmissionCreatedEvent |
Dispatched when a user starts a new wizard |
WizardPaymentInitiatedEvent |
Dispatched when the user is redirected to a PSP |
WizardPaymentFailedEvent |
Dispatched if a payment transaction fails |
WizardSubmissionCompletedEvent |
Dispatched when the wizard is fully finished |
Development
composer install composer qa
QA tools include:
- ECS
- PHPStan
- Rector
- PHPUnit
Documentation
License
MIT