Warning
MForm 10 ist noch nicht final. Der Branch main und die Releases 10.0.0-beta.* und 10.0.0-rc.* sind Vorabversionen: nur zum Testen, nicht für produktive Installationen, vorher Backup anlegen. PHP 8.4 ist Pflicht, MBlock wird nicht mehr unterstützt (Migrationsassistent unter „MBlock zu Repeater“). Rückmeldungen bitte in #448. Die stabile Linie 9.5.x liegt im Branch 9.x.
MForm takes the pain out of building REDAXO module inputs. Instead of writing raw HTML form markup, everything gets defined in clean PHP — from a simple text field to fully nested, copy-paste-capable repeaters with conditional logic.
Not just for modules: MForm also extends YForm and rex_form with custom widgets like the custom link field, image lists, or the ColorSwatch picker.
- Builds module input forms via a fluent PHP API (
MForm::factory()->addTextField(...)->...->show()) - Provides a Flex Repeater for dynamically repeatable form rows — supporting nesting, copy/paste, and per-item enable/disable
- Keeps dropdown-based controls usable inside the Flex Repeater by allowing open menus to overflow their item wrapper when needed
- Ships reusable form logic via a Template API (
registerTemplate,fromTemplate,applyTemplate) - Adds helper classes for Repeater output:
MFormRepeaterHelper::decode(),filterByField(),sortByField(),groupByField(),limitItems() - Adds YForm value types:
custom_link,custom_link_multi,color_swatch - Resolves readable labels for stored dataset links like
rex-<table>://<id>in the custom link widget when possible - Opens the Linkmap overlay for link and dataset selection and the MediaPlace overlay for media when those addons are installed, with the classic popups as fallback
- Conditional visibility with multiple rules (
setVisibleIf,addVisibleIf,setHiddenIf, all or any) and a tags field (addTagsField) for keywords as pills - Optional accessibility check for media fields (
'a11y' => ['med_alt']): warns right in the widget when ALT text or other media pool metadata is missing, honours decorative images, MediaPlace and multilingual metainfo fields - Offers a growing library of installable demo modules directly from the REDAXO backend
use FriendsOfRedaxo\MForm;
echo MForm::factory()
->addTabElement('Content', MForm::factory()
->addTextField(1, ['label' => 'Headline'])
->addColorSwatchField(2, [
'#ffffff' => 'White',
'#111111' => 'Black',
'.bg-primary' => ['label' => 'Primary', 'preview' => '#0d6efd'],
], ['label' => 'Background'])
)
->addTabElement('Items', MForm::factory()
->addRepeaterElement(3, MForm::factory()
->addTextField('title', ['label' => 'Title'])
->addMediaField('image', ['label' => 'Image'])
, true, true, ['min' => 1, 'max' => 10, 'copy_paste' => true])
)
->show();The full documentation is available directly inside the REDAXO backend under MForm → Docs.
For a step-by-step introduction, check out the FOR Tutorial section on MForm.
MBlock users looking to migrate should start with docs/08_mblock_migration.md.
For component-driven frontend output, see docs/14_fragments_output.md.
Install directly via the REDAXO Installer — search for mform, download and activate.
Project Lead
Thanks to all contributors who helped shape MForm over the years!
Top contributors
| Contributor | |
|---|---|
| 1 | ynamite |
| 2 | marcohanke |
| 3 | eaCe |
| 4 | schuer |
| 5 | dtpop |
| 6 | IngoWinter |
| 7 | thorol |
| 8 | DanielWeitenauer |
A big thank you also to interweave-media, olien, elricco, staabm, ascky-thorben, dpf-dd, nandes2062, dgrothaus-mc, lexplatt, danspringer, Geri2017, omphteliba, bitshiftersgmbh, TobiasKrais, VIEWSION, christophboecker, cukabeka and philippparth.
A Friends Of REDAXO project
