From 37026c4a8a17a036d8547c1d81787bbda199e857 Mon Sep 17 00:00:00 2001 From: tp_dhu Date: Sun, 9 Feb 2025 20:04:14 +0000 Subject: [PATCH] added static methods to create horizontal fields using bulma.io css --- app/model/BulmaForm.php | 83 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 app/model/BulmaForm.php diff --git a/app/model/BulmaForm.php b/app/model/BulmaForm.php new file mode 100644 index 0000000..1f72e98 --- /dev/null +++ b/app/model/BulmaForm.php @@ -0,0 +1,83 @@ + +
+ +
+
+
+
+ +
+
+
+ + '; + + $string = str_replace('%label%', $label, $string); + $string = str_replace('%name%', $name, $string); + $string = str_replace('%value%', $value, $string); + + return $string; + } + + public static function horizontal_field_textarea($label = "%label%", $name = "%name%", $value=""){ + $string = ' +
+
+ +
+
+
+
+ +
+
+
+
+ '; + + $string = str_replace('%label%', $label, $string); + $string = str_replace('%name%', $name, $string); + $string = str_replace('%value%', $value, $string); + + return $string; + } + + public static function horizontal_field_select($label="%label%", $name="%name%", $options=[], $selected=0){ + $string = ' +
+
+ +
+
+
+
+ +
+
+
+
+ '; + + $string = str_replace('%label%', $label, $string); + $string = str_replace('%name%', $name, $string); + $opts_str = ''; $i=0; + foreach($options as $v){ + $opts_str .= ''.$v.''; + $i++; + } + $string = str_replace('%options%', $opts_str, $string); + + return $string; + } + +} \ No newline at end of file