yiggle/form-wizard-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yiggle/form-wizard-bundle

Composer 安装命令:

composer require yiggle/form-wizard-bundle

包简介

Sulu 3 Form Wizard

README 文档

README

CI Latest Version Downloads License

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. Answer n when prompted to overwrite webpack.config.js and package.json during 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

yiggle/form-wizard-bundle 适用场景与选型建议

yiggle/form-wizard-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 74 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 03 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 yiggle/form-wizard-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 yiggle/form-wizard-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 yiggle/form-wizard-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 74
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 16
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-03