Skip to content
This repository has been archived by the owner on Dec 22, 2020. It is now read-only.

Latest commit

 

History

History
28 lines (19 loc) · 577 Bytes

README.md

File metadata and controls

28 lines (19 loc) · 577 Bytes

PhpLiteFormBuilder

PhpLiteFormBuilder is lite library for manipulating (creating and processing) forms in php.

Basic form:

$form = new Form('myForm', 'post', 'action_file.php');

$form->addElement(new InputText())->setName('name')->setId('name')->setLabel(new Label('Name:'));
$form->addElement(new InputSubmit())->setValue('Submit');

$form->create();

$form->render();

Getting data:

$mform = Form::getForm('myForm');

if ( $mform instanceof Form)
  if ( $mform->isValid() ) {
    $data = $mform->getData();
    $name = $data['name'];
  }