Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dekyfin/php-array-forms
https://github.com/dekyfin/php-array-forms
form-builder php php-array
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dekyfin/php-array-forms
- Owner: dekyfin
- Created: 2018-01-19T13:59:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-01-25T10:23:23.000Z (over 6 years ago)
- Last Synced: 2024-09-24T20:09:00.728Z (3 days ago)
- Topics: form-builder, php, php-array
- Language: PHP
- Size: 9.77 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP ARRAY FORMS
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