diff options
author | Malf Furious <m@lfurio.us> | 2018-09-15 22:09:54 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2018-09-15 22:09:54 -0400 |
commit | 4c841f42df89d876058c2a785167247ca8748e77 (patch) | |
tree | 21fada360265968fc3368adb666b245f58f7af81 /app | |
parent | ba3412610b5a964b5401378ec68a2bed2d816cdc (diff) | |
download | scrott-4c841f42df89d876058c2a785167247ca8748e77.tar.gz scrott-4c841f42df89d876058c2a785167247ca8748e77.zip |
Add checkbox formctrl
Diffstat (limited to 'app')
-rw-r--r-- | app/view/formctrl.php | 9 |
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 } ?> |