diff options
| author | Thomas Hackl <hackl@data-quest.de> | 2026-03-17 08:58:39 +0100 |
|---|---|---|
| committer | Thomas Hackl <hackl@data-quest.de> | 2026-03-17 09:01:06 +0100 |
| commit | 7ab6009e8c6d420803d0ce249f1373bf62c59a5d (patch) | |
| tree | 9815d978be67d3dcf077f23310d3498244a3c849 /lib/classes/forms | |
| parent | 0062fad070cffd7d38024118939fe5c9d9be79d6 (diff) | |
working form validationwizard
Diffstat (limited to 'lib/classes/forms')
| -rw-r--r-- | lib/classes/forms/Form.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/classes/forms/Form.php b/lib/classes/forms/Form.php index f34b68d..58ff72d 100644 --- a/lib/classes/forms/Form.php +++ b/lib/classes/forms/Form.php @@ -314,7 +314,7 @@ class Form extends Part return $this; } - public function validate() + public function validate(bool $return = false) { if (\Request::isPost() && \Request::submitted('STUDIPFORM_SERVERVALIDATION')) { //verify the user input: @@ -333,10 +333,14 @@ class Form extends Part } } } - header('Content-Type: application/json'); - echo json_encode($output); sess()->save(); - die(); + if ($return) { + return $output; + } else { + header('Content-Type: application/json'); + echo json_encode($output); + die(); + } } return $this; } |
