diff options
author | Malf Furious <m@lfurio.us> | 2017-06-27 01:26:33 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2017-06-27 01:26:33 -0400 |
commit | c8d6725f2dfb378c744c569df1b9981623808c87 (patch) | |
tree | 6d417b3f860190a1c754cb442fa2b55f3e64baea /app/view | |
parent | b5b8c3b6d23871a289b4184d77a8bfc1608b80aa (diff) | |
download | scrott-c8d6725f2dfb378c744c569df1b9981623808c87.tar.gz scrott-c8d6725f2dfb378c744c569df1b9981623808c87.zip |
Reformat view helper modules
To limit whitespace being piped to the client, remove empty lines of
free HTML between PHP functions defined in view files. To maintain
readability, this spacing is added back at the top and bottom of each
PHP function.
Diffstat (limited to 'app/view')
-rw-r--r-- | app/view/formctrl.php | 5 | ||||
-rw-r--r-- | app/view/stdpage.php | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/app/view/formctrl.php b/app/view/formctrl.php index deac491..ee0243f 100644 --- a/app/view/formctrl.php +++ b/app/view/formctrl.php @@ -18,15 +18,18 @@ namespace formctrl; <?php function text(string $label, string $name, string $value = "", string $placeholder = "", bool $required = true, bool $disabled = false) : void { ?> + <div class="form-group"> <label><?=$label?></label> <input type="text" name="input[<?=$name?>]" value="<?=$value?>" placeholder="<?=$placeholder?>" class="form-control" <?=($required ? "required" : "")?> <?=($disabled ? "disabled" : "")?> /> </div> -<?php } ?> +<?php } ?> <?php function password(string $label, string $name, bool $required = true) : void {?> + <div class="form-group"> <label><?=$label?></label> <input type="password" name="input[<?=$name?>]" class="form-control" <?=($required ? "required" : "")?> /> </div> + <?php } ?> diff --git a/app/view/stdpage.php b/app/view/stdpage.php index 157dc1b..4bdc0c5 100644 --- a/app/view/stdpage.php +++ b/app/view/stdpage.php @@ -17,7 +17,6 @@ namespace stdpage; require_once "class/globals.php"; ?> - <?php function head(?string $title = NULL) : void { ?> <!-- @@ -54,12 +53,14 @@ require_once "class/globals.php"; <title>Scrott<?=($title ? " - ".$title : "")?></title> <link rel="stylesheet" type="text/css" href="<?=ar()?>/static/css/bootstrap.min.css" /> -<?php } ?> -<?php function top() : void { ?> <?php } ?> +<?php function top() : void { ?> +<?php } ?> <?php function foot() : void { ?> + <script type="text/javascript" src="<?=ar()?>/static/js/jquery.min.js"></script> <script type="text/javascript" src="<?=ar()?>/static/js/bootstrap.min.js"></script> + <?php } ?> |