Initial import
This commit is contained in:
44
lib/Form.php
Executable file
44
lib/Form.php
Executable file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
class Form {
|
||||
|
||||
public static function input($title, $name, $value, $attrs = []) {
|
||||
$at = [];
|
||||
foreach ($attrs as $k=>$v) {
|
||||
$at[] = "$k = \"$v\"";
|
||||
}
|
||||
|
||||
return blade("forms.input", [
|
||||
"title" => $title,
|
||||
"name" => $name,
|
||||
"value" => $value,
|
||||
"attrs" => implode(" ", $at)
|
||||
]);
|
||||
}
|
||||
|
||||
public static function password($title, $name, $value, $attrs = []) {
|
||||
$at = [];
|
||||
foreach ($attrs as $k=>$v) {
|
||||
$at[] = "$k = \"$v\"";
|
||||
}
|
||||
|
||||
return blade("forms.password", [
|
||||
"title" => $title,
|
||||
"name" => $name,
|
||||
"value" => $value,
|
||||
"attrs" => implode(" ", $at)
|
||||
]);
|
||||
}
|
||||
|
||||
public static function submit($title, $attrs = []) {
|
||||
$at = [];
|
||||
foreach ($attrs as $k=>$v) {
|
||||
$at[] = "$k = \"$v\"";
|
||||
}
|
||||
|
||||
return blade("forms.submit", [
|
||||
"title" => $title,
|
||||
"attrs" => implode(" ", $at)
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user