Created
May 2, 2014 08:53
-
-
Save jsrn/0610c7ef00faed967609 to your computer and use it in GitHub Desktop.
Form Helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class FormHelper { | |
public static function input($name, $placeholder, $value=null) { | |
echo '<input id="' . $name . '" name="' . $name . '" | |
placeholder="' . $placeholder . '" value="' . htmlentities($value) . '">'; | |
} | |
public static function labelAndInput($name, $label, $value=null) { | |
echo '<label for="' . $name . '">' . $label . "</label>"; | |
echo '<input id="' . $name . '" name="' . $name . '" | |
placeholder="' . $label . '" value="' . htmlentities($value) . '">'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment