\SimpleDocForm

Provides a form generator and a data validator

Summary

Methods
Properties
Constants
__construct()
addInput()
addSubmit()
renderHTML()
getValues()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$name
$method
$action
$inputs
$submit
N/A

Properties

$name

$name : string

Name of the form

Type

string

$method

$method : string

Method of the form (POST, GET, PUT)

Type

string

$action

$action : string

Action of the form

Type

string

$inputs

$inputs : array

Added inputs to the form

Type

array

$submit

$submit : \SimpleDoc\SubmitButton

Added submit button to the form

Type

\SimpleDoc\SubmitButton

Methods

__construct()

__construct(string  $name, string  $method = 'POST', string  $action = '') : void

Initialize the form

Parameters

string $name
string $method
string $action

addInput()

addInput(string  $name, string  $type = 'text', string  $label = '', array  $class = array('form-control'), string  $id = '') : void

Add an input to the form

Parameters

string $name
string $type
string $label
array $class
string $id

addSubmit()

addSubmit(string  $name, string  $type = 'text', string  $label = '', array  $class = array('btn btn-primary'), string  $id = '') : void

Add a submit button to the form

Parameters

string $name
string $type
string $label
array $class
string $id

renderHTML()

renderHTML() : void

Render the form into HTML

getValues()

getValues(array  $post) : void

Get values of the form

Parameters

array $post