From b2a86c7df7d5a473e80034832a01b21444fa50e6 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 6 Mar 2022 00:48:14 +0100 Subject: Refactor --- src/Controllers/ValidationController.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/Controllers/ValidationController.php (limited to 'src/Controllers/ValidationController.php') diff --git a/src/Controllers/ValidationController.php b/src/Controllers/ValidationController.php new file mode 100644 index 0000000..f90359a --- /dev/null +++ b/src/Controllers/ValidationController.php @@ -0,0 +1,26 @@ +buildFields($_GET['page'] ?? null); + + $result = $validator->validateRequest($fields); + + $content['data'] = $result['fields']; + if (! empty($result['error'])) { + $content['error'] = $result['error']; + } + + return $content; + } +} -- cgit v1.2.3