Skip to content

FriendsOfREDAXO/mform

Repository files navigation

MForm – REDAXO Addon

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

Quick example

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

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
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

About

Spielend einfach umfangreiche Modul-Input-Formulare erzeugen.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors