Skip to content

Repository files navigation

MForm – REDAXO Addon

Static AnalysisPHPLicense: MIT

Poster

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.

What MForm does

  • 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
  • Offers a growing library of installable demo modules directly from the REDAXO backend

Quick example

useFriendsOfRedaxo\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();

Documentation & Tutorial

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.

Installation

Install directly via the REDAXO Installer — search for mform, download and activate.

License

MIT License

Credits

Project Lead

Joachim Dörr

Thomas Skerbis


Thanks to all contributors who helped shape MForm over the years!

Top contributors

Contributor
1ynamite
2marcohanke
3eaCe
4schuer
5dtpop
6IngoWinter
7thorol
8DanielWeitenauer

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

About

Spielend einfach umfangreiche Modul-Input-Formulare erzeugen.

Topics

Resources

Code of conduct

Security policy

Stars

84 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages