diff options
author | Malf Furious <m@lfurio.us> | 2018-09-15 22:03:32 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2018-09-15 22:03:32 -0400 |
commit | ba3412610b5a964b5401378ec68a2bed2d816cdc (patch) | |
tree | 0d4e1a5412376ae21ccdd5202c568b9d25ff0d63 /app/view/formctrl.php | |
parent | 1eef7c438b236d57da16e7cccee7f182e440e8b1 (diff) | |
download | scrott-ba3412610b5a964b5401378ec68a2bed2d816cdc.tar.gz scrott-ba3412610b5a964b5401378ec68a2bed2d816cdc.zip |
Add css class and help-block to text formctrl
Diffstat (limited to 'app/view/formctrl.php')
-rw-r--r-- | app/view/formctrl.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/view/formctrl.php b/app/view/formctrl.php index 131b0de..2723791 100644 --- a/app/view/formctrl.php +++ b/app/view/formctrl.php @@ -21,11 +21,15 @@ namespace formctrl; <?php } ?> <?php function text(string $label, string $name, string $value = "", string $placeholder = "", - bool $required = true, bool $disabled = false) : void { ?> + bool $required = true, bool $disabled = false, string $cls = "", ?string $help = NULL) : void { ?> - <div class="form-group"> + <div class="form-group <?=$cls?>"> <label class="control-label"><?=$label?></label> <input type="text" name="input[<?=$name?>]" value="<?=$value?>" placeholder="<?=$placeholder?>" class="form-control" <?=($required ? "required" : "")?> <?=($disabled ? "disabled" : "")?> maxlength="64" /> + + <?php if ($help) { ?> + <span class="help-block"><?=$help?></span> + <?php } ?> </div> <?php } ?> |