Skip to content

Latest commit

 

History

History
37 lines (21 loc) · 778 Bytes

File metadata and controls

37 lines (21 loc) · 778 Bytes

Read me

This is just a simple class to simplify making forms in PHP.

Sample usage is in form.php

Calling the class

Instanciating the class, there are three optional parameters. $action, $method and $enctype. By default, $action = NULL, $method = 'POST' and $enctype = NULL. And error will be thrown if the $method is not set to POST and an enctype is set.

Executing

$form->show() will return the finished form.

Multiple forms

For multiple forms, you'll need multiple instances of the class.

Usage

Below is some sample usage:

$form = new Form();

$form->label('Username: ');
$form->input('Username');

$form->label('Password: ');
$form->input('password');

$form->submit();

echo $form->show()

More sample code in 'form.php'