dekyfin/php-array-forms
Composer 安装命令:
composer require dekyfin/php-array-forms
包简介
A package to create HTML FORMS from PHP Array
README 文档
README
A library that allows you to create HTML forms using PHP Arrays. The project was inspired by Titan Framework and uses the same format for generating elements
INSTALLATION
Composer
composer require dekyfin/php-array-forms
Direct Install
##USAGE
-Include the DF\ArrayForm class
--Composer: require_once "vendor/autoload.php"
--Direct Install: require_once "path/to/ArrayForm.php"
Example
#Attributes to be used for the form
$formData = [
"action" => "/path/to/form/processor.php",
"method" => "post",
"class" => "my-special-form",
"id" => "myForm",
"display" => "table"
];
$elements = [
[
"id" => "email",
"name" => "Email",
"type" => "email"
"required" => true,
],
[
"id" => "pass",
"name" => "Password",
"type" => "password",
"required" => true,
],
[
"id" => "amount",
"name" => "Amount",
"type" => "number",
"step" => "0.01",
"min" => "3",
],
[
"id" => "payment[method]",
"name" => "Payment Method",
"type" => "select",
"options" => ["true", "false"],
]
];
$form = DF\ArrayForm( $formData, $elements );
$html = $form->$build();
echo $html
OPTIONS
formData
elements
统计信息
- 总下载量: 20
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2018-01-22