From 2dea80b58e732d7dd57e2e9e030bec5a970b0753 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Tue, 23 Sep 2025 14:42:47 +0200 Subject: [PATCH] InlineFormView: split rendering into smaller methods --- templates/InlineFormView.php | 102 ++++++++++++++++++++--------------- 1 file changed, 60 insertions(+), 42 deletions(-) diff --git a/templates/InlineFormView.php b/templates/InlineFormView.php index b047b6b..b3f7368 100644 --- a/templates/InlineFormView.php +++ b/templates/InlineFormView.php @@ -26,42 +26,9 @@ class InlineFormView foreach ($form['fields'] as $name => $field) { if ($field['type'] === 'select') - { - echo ' - '; - } + self::renderSelectBox($field, $name); else - echo ' - '; + self::renderInputBox($field, $name); if (isset($field['html_after'])) echo $field['html_after']; @@ -74,13 +41,7 @@ class InlineFormView if (!empty($form['buttons'])) foreach ($form['buttons'] as $name => $button) { - echo ' - '; + self::renderSubmitButton($button, $name); if (isset($button['html_after'])) echo $button['html_after']; @@ -97,4 +58,61 @@ class InlineFormView echo ' '; } + + private static function renderInputBox(array $field, $name) + { + echo ' + '; + } + + private static function renderSelectBox(array $field, $name) + { + echo ' + '; + } + + private static function renderSubmitButton(array $button, $name) + { + echo ' + '; + } }