Skip to content

MelisFormCreator ​

The back-office form builder of MelisPlatform — design fields, groups, rules, statuses, validation workflows, computed formulas and versions. Package melisplatform/melis-form-creator.

Purpose ​

MelisFormCreator is the admin tool where a developer or content manager designs a form: it drags fields into steps, configures field types, groups, conditional rules, answer statuses, a multi-step approval workflow ("Instruction"), and computed formulas. It writes the resulting definition into MelisFormEngine's tables (melis_forms*) — the engine is responsible for rendering the form to visitors and storing answers. This module owns only two small catalog tables: field-type definitions and formula definitions.

Enable it ​

Add to config/melis.module.load.php:

php
return [
    // …
    'MelisFormCreator',
];

Required dependencies (declared in composer.json):

  • melisplatform/melis-core ^5.3 — event manager, service manager, BO tool chrome, translations.
  • melisplatform/melis-form-engine ^5.3 — owns the form/field/answer tables and the renderer; this module writes into them.
  • melisplatform/melis-small-business ^5.3 — the workflow engine behind the Instruction approval process.
  • mossadal/math-parser ^1.3 — evaluates formula math expressions.
  • jms/serializer + doctrine/instantiator — (de)serialize the formula entity graph.

Key services ​

Service aliasRole
FormCreatorFormulaServiceResolves a formula's registered view helper (from mff_helper_file) and renders the formula tree; handles JSON ↔ XML conversion and parameter extraction.
FormCreatorFieldTypeTableGateway for the mfft_* field-type catalog table.
FormCreatorFormulaTableGateway for the mff_* formula definitions table.

Backoffice ​

Accessed via Marketing → Form Creator (menu key melisformcreator_tool, icon fa fa-th-large). All controllers are reachable under the generic route /MelisFormCreator/[:controller[/:action]].

Catalog tabs ​

TabControllerRole
FormFormCreatorFormControllerList, create, clone (FormCreatorCloneFormController), open and delete forms.
FieldsFormCreatorFieldControllerReusable fields defined once and shared across all forms.
Field TypesFormCreatorFieldTypesControllerSystem catalog of field types (text, select, checkbox, computation…) — read-mostly.
GroupsFormCreatorGroupsControllerSections that group fields together on a form.
RulesFormCreatorRulesControllerConditional logic — show/hide a field depending on another field's value, using rule helpers (compare-number, compare-text).
StatusFormCreatorStatusControllerAnswer statuses a submission can move through (e.g. New, Validated, Rejected).
InstructionFormCreatorInstruction*Controller (Ă—4)The validation workflow: Process (stages), Validators (approvers), Reasons (rejection/action reasons), Comments (note templates).
FormulasFormCreatorFormulasControllerComputed expressions derived from other fields; attached to a field of type computation.

Form-edition page tabs (per form) ​

TabRole
FormVisual builder — drag fields into steps, order them, set labels/translations.
PropertiesForm-level settings.
Status RulesRules that move an answer between statuses.
VersionsVersion timeline (major.minor.maintenance) — every structural change adds a maintenance version automatically.
InstructionAttach a validation Process to the form.
Entry ParametersPre-fill answers from entry parameters.

Database tables ​

This module owns only two tables. All forms, fields, groups, rules, statuses, versions and answers are stored by MelisFormEngine (melis_forms* tables).

Table modelPKHolds
MelisFormCreatorFieldTypeTablemfft_idThe field-type catalog (text, select, checkbox, computation…).
MelisFormCreatorFormulaTablemff_idFormula definitions — mff_helper_file, mff_name, mff_description, mff_xml (serialized formula tree).

Events & listeners ​

Because a form's structure is XML in the engine but its parts (fields, statuses, validators…) are edited separately, Module.php attaches listeners that re-sync every form when a shared part changes.

ListenerEvent(s)Effect
MelisFormCreatorFormVersioningListenermelisformcreator_form_update_start / …_update_endSnapshots form XML; on change writes a new maintenance version and bumps mf_current_version_maintenance.
MelisFormCreatorUpdateFieldListenermelisformcreator_save_field_endRewrites the field's XML inside every form that uses it (including as a secondary field).
MelisFormCreatorDeleteFieldListenermelisformcreator_delete_field_endRemoves the field from every form's XML.
MelisFormCreatorUpdateValidatorListener / …DeleteValidatorListenermelisformcreator_save_validator_end / melisformcreator_delete_validator_endSync or remove the validator across form XML.
MelisFormCreatorUpdateProcessListener / …DeleteProcessListenermelisformcreator_save_process_end / melisformcreator_delete_process_endSync or remove the process across form XML.
MelisFormCreatorDeleteStatusListenermelisformcreator_delete_status_endStrip the status from form XML.
MelisFormCreatorDeleteReasonListenermelisformcreator_delete_reason_endUpdate affected answer XML via the engine's answers service.
MelisFormCreatorFormulaUpdateFieldListenermelisformcreator_form_field_set_field_config_xml_end, melisformcreator_validate_form_field, melisformcreator_format_post_valuesInject <formula> + parameters into a computation field, validate it, and convert formula JSON→XML on save.
MelisFormFormulaParametersListenermelisformcreator_formula_parametersFill formula parameter values from the current answer context.
MelisFormCreatorFlashMessengerListener…_save_*_end / …_delete_*_endBack-office flash feedback.

Extending the builder

Listen on the melisformcreator_save_*_end / melisformcreator_delete_*_end events — you receive the saved/deleted entity after the core logic ran, exactly as the built-in sync listeners do.

View helpers ​

HelperUse
FormulaHelperRender the formula tree UI; convert XML ↔ JSON; extract parameters.
FormulaTextLanguageHelperMultilingual labels for formula nodes.
SecondaryFieldHelperPick a "secondary" (referencing) field. Reused by MelisFormTool and MelisDocumentGenerator.
ToolTipTableBuild configurable tooltip tables (groups/validators/reasons). Reused by MelisFormTool and MelisDocumentGenerator.
ValidatorBtnHelperValidator action buttons in the Instruction UI.

Example ​

Listen to a post-save event to run custom logic after a field is updated:

php
// In your module's Module::onBootstrap()
$eventManager = $e->getApplication()->getEventManager();
$eventManager->attach(
    'melisformcreator_save_field_end',
    function ($event) {
        $savedField = $event->getParam('savedField');
        // your custom sync or notification logic here
    }
);

Key files ​

ConcernPath
Module bootstrap & listenersvendor/melisplatform/melis-form-creator/src/Module.php
Routing, services, controllers, view helpersvendor/melisplatform/melis-form-creator/config/module.config.php
Left-menu entryvendor/melisplatform/melis-form-creator/config/app.interface.php
Catalog tabs + form-edition tabsvendor/melisplatform/melis-form-creator/config/app.tools.php
Rule helpers (compare-number / compare-text)vendor/melisplatform/melis-form-creator/config/rulehelper.config.php
Formula / field-type / instruction form schemasvendor/melisplatform/melis-form-creator/config/app.formula.forms.php
Formula servicevendor/melisplatform/melis-form-creator/src/Service/MelisFormCreatorFormulaService.php
Formula entity graphvendor/melisplatform/melis-form-creator/src/Entity/
Form-XML sync listenersvendor/melisplatform/melis-form-creator/src/Listener/
View helpersvendor/melisplatform/melis-form-creator/src/View/Helper/
Table gateways (field-types, formulas)vendor/melisplatform/melis-form-creator/src/Model/Tables/

See also: MelisFormEngine, MelisSmallBusiness