summaryrefslogtreecommitdiffstats
path: root/app/view/formctrl.php
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2018-09-15 22:09:54 -0400
committerMalf Furious <m@lfurio.us>2018-09-15 22:09:54 -0400
commit4c841f42df89d876058c2a785167247ca8748e77 (patch)
tree21fada360265968fc3368adb666b245f58f7af81 /app/view/formctrl.php
parentba3412610b5a964b5401378ec68a2bed2d816cdc (diff)
downloadscrott-4c841f42df89d876058c2a785167247ca8748e77.tar.gz
scrott-4c841f42df89d876058c2a785167247ca8748e77.zip
Add checkbox formctrl
Diffstat (limited to 'app/view/formctrl.php')
-rw-r--r--app/view/formctrl.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/view/formctrl.php b/app/view/formctrl.php
index 2723791..7433bbb 100644
--- a/app/view/formctrl.php
+++ b/app/view/formctrl.php
@@ -41,3 +41,12 @@ namespace formctrl;
</div>
<?php } ?>
+<?php function checkbox(string $label, string $name, bool $checked = false, bool $disabled = false, ?string $collapse = NULL) : void { ?>
+
+ <div class="checkbox">
+ <label <?=($collapse ? "data-toggle=\"collapse\" data-target=\"$collapse\"" : "")?>>
+ <input type="checkbox" name="input[<?=$name?>]" value="1" <?=($checked ? "checked" : "")?> <?=($disabled ? "disabled" : "")?> /> <?=$label?>
+ </label>
+ </div>
+
+<?php } ?>