summaryrefslogtreecommitdiffstats
path: root/app/view/formctrl.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/view/formctrl.php')
-rw-r--r--app/view/formctrl.php8
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 } ?>