Forms

The configuration for forms is settable at the path config.tx_formz.forms. We can find the list of all forms. Each configuration must use as a key the class name of the form.

Example: config.tx_formz.forms.MyVendor\MyExtension\Form\ExampleForm { ... }

Properties

You can find below the list of parameters usable by a form.

Property Title
* fields Fields of the form
activationCondition Activation conditions
settings.defaultClass Default class
settings.defaultErrorMessage Default error message

Form fields

Property

fields

Required?

Yes

Description

Contains the list of fields for the form.

Note that each field must bind a property of the form's PHP model, in order to be processed.

Activation conditions

Property

activationCondition

Required?

No

Description

Contains the list of activation conditions which are usable by all the fields of this form. These conditions may then be used in the activation logical expressions of a field (see “Field activation”) or a field validation.

For more information on this, read the chapter “Activation”.

Example:

activationCondition {
    colorIsRed {
        type = fieldHasValue
        fieldName = color
        fieldValue = red
    }

    colorIsBlue {
        type = fieldHasValue
        fieldName = color
        fieldValue = blue
    }
}

Note

Several condition types are available with FormZ core, see chapter “Activation”.

Default class

Property

settings.defaultClass

Required?

No

Description

Class given by default to the <form> tag when using the ViewHelper Romm\Formz\ViewHelpers\FormViewHelper.

The default value is formz.

Default error message

Property

settings.defaultErrorMessage

Required?

No

Description

When an error is bound to a field, if for an unknown reason the error message is empty, the value of this property will be used instead.

It main contain a LLL reference.