Skip to content

Commit e63be8a

Browse files
authored
Clarify $formId parameter (#1636)
1 parent 2b49912 commit e63be8a

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

docs/dev/reference/hooks/compileFormFields.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ and expects the modified form fields as return value.
2121

2222
2. *string* `$formId`
2323

24-
Alias of the current form. Used in the `value` attribute of the hidden form
25-
field `FORM_SUBMIT`. Don't confuse with `$objForm->id`.
24+
Alias of the current form with the prefix `auto_`. Don't confuse with `$form->id`.
2625

2726
3. *\Contao\Form* `$form`
2827

docs/dev/reference/hooks/loadFormField.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ field of the form generator.
2222

2323
2. *string* `$formId`
2424

25-
Alias of the current form. Used in the `value` attribute of the hidden form
26-
field `FORM_SUBMIT`. Don't confuse with `$form->id`.
25+
Alias of the current form with the prefix `auto_`. Don't confuse with `$form->id`.
2726

2827
3. *array* `$formData`
2928

@@ -55,7 +54,7 @@ class LoadFormFieldListener
5554
{
5655
public function __invoke(Widget $widget, string $formId, array $formData, Form $form): Widget
5756
{
58-
if ('myForm' === $formId) {
57+
if ('myForm' === $form->formID) {
5958
$widget->class.= ' myclass';
6059
}
6160

docs/dev/reference/hooks/validateFormField.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ object as return value.
2121

2222
2. *string* `$formId`
2323

24-
Alias of the current form. Used in the `value` attribute of the hidden form field `FORM_SUBMIT`. Do not confuse with `$form->id`.
24+
Alias of the current form with the prefix `auto_`. Don't confuse with `$form->id`.
2525

2626
3. *array* `$formData`
2727

@@ -52,7 +52,7 @@ class ValidateFormFieldListener
5252
{
5353
public function __invoke(Widget $widget, string $formId, array $formData, Form $form): Widget
5454
{
55-
if ('myform' === $formId && 'mywidget' === $widget->name) {
55+
if ('myform' === $form->formID && 'mywidget' === $widget->name) {
5656
// Do your custom validation and add an error if widget does not validate
5757
// …
5858

0 commit comments

Comments
 (0)