From 2838aaad14c0deb34a125dc2b5b397ccefa28d76 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Sat, 25 Jul 2020 17:50:23 +0000 Subject: [PATCH] [FORM] Add Form::isRequired --- src/Core/Form.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Core/Form.php b/src/Core/Form.php index 67ec0c5694..93a996341b 100644 --- a/src/Core/Form.php +++ b/src/Core/Form.php @@ -52,4 +52,9 @@ abstract class Form } return $fb->getForm(); } + + public static function isRequired(array $form, string $field): bool + { + return $form[$field][2]['required'] ?? true; + } }