2017 © Pedro Peláez
 

library php-array-forms

A package to create HTML FORMS from PHP Array

image

dekyfin/php-array-forms

A package to create HTML FORMS from PHP Array

  • Wednesday, January 24, 2018
  • by dekyfin
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

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, (*1)

INSTALLATION

Composer

composer require dekyfin/php-array-forms, (*2)

Direct Install

USAGE

-Include the DF\ArrayForm class --Composer: require_once "vendor/autoload.php" --Direct Install: require_once "path/to/ArrayForm.php", (*3)

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

The Versions

24/01 2018

dev-master

9999999-dev

A package to create HTML FORMS from PHP Array

  Sources   Download

The Requires

  • php >=5.3.0

 

by Desmond Kyeremeh

24/01 2018

0.3

0.3.0.0

A package to create HTML FORMS from PHP Array

  Sources   Download

The Requires

  • php >=5.3.0

 

by Desmond Kyeremeh

23/01 2018

0.2

0.2.0.0

A package to create HTML FORMS from PHP Array

  Sources   Download

The Requires

  • php >=5.3.0

 

by Desmond Kyeremeh

23/01 2018

0.1.1

0.1.1.0

A package to create HTML FORMS from PHP Array

  Sources   Download

The Requires

  • php >=5.3.0

 

by Desmond Kyeremeh

22/01 2018

0.1

0.1.0.0

A package to create HTML FORMS from PHP Array

  Sources   Download

The Requires

  • php >=5.3.0

 

by Desmond Kyeremeh