From 3ed1f19a31762c154cadf4b520f4d912bf0c0680 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 3 Sep 2024 16:40:46 +0200 Subject: [PATCH] Pass field name and widget to input callback --- src/Form/Form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Form/Form.php b/src/Form/Form.php index b259153..0eda522 100644 --- a/src/Form/Form.php +++ b/src/Form/Form.php @@ -737,7 +737,7 @@ public function validate(): bool foreach ($this->widgets as $fieldName => $widget) { if (null !== $this->inputCallback && method_exists($widget, 'setInputCallback')) { - $widget->setInputCallback($this->inputCallback); + $widget->setInputCallback(static fn () => ${$this->inputCallback}($fieldName, $widget)); } $widget->validate();