From 4da8be3bf5b00adeae00ec458cd6f61bbf6dd703 Mon Sep 17 00:00:00 2001 From: shoosah Date: Tue, 14 May 2019 09:47:14 +1200 Subject: [PATCH] Add extend function in getSchemaValidation function This allows to create extensions which add validation list --- src/Forms/FormField.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Forms/FormField.php b/src/Forms/FormField.php index 5a9b65bef..ca9034049 100644 --- a/src/Forms/FormField.php +++ b/src/Forms/FormField.php @@ -1609,9 +1609,11 @@ class FormField extends RequestHandler */ public function getSchemaValidation() { + $validationList = []; if ($this->Required()) { - return [ 'required' => true ]; + $validationList['required'] = true; } - return []; + $this->extend('updateSchemaValidation', $validationList); + return $validationList; } }