class BootstrapForm extends Form

Class BootstrapForm Form rendered using Bootstrap 4

Traits

Trait BootstrapContainerTrait.
Trait AddRowTrait. Implements method to add a bootstrap row.

Properties

string $ajaxClass
protected Html $elementPrototype
bool $ajax
int $renderMode
bool $showValidation If valid fields should explicitly be green if valid
bool $autoShowValidation If true, valid inputs will be explicitly green on unsuccessful submit

Methods

addButton(string $name, null|string| Html $content = NULL, string $btnClass = 'btn-secondary')

No description

addCheckbox(string $name, null $caption = NULL)

No description

addCheckboxList(string $name, null $label = NULL, array $items = NULL)

No description

addComponent( IComponent $component, $name, $insertBefore = NULL)

No description

addDateTime(string $name, string $label)

Adds a datetime input.

addEmail($name, null $label = NULL)

No description

addInputError(string $componentName, string $message)

Adds error to a specific component

addInteger(string $name, string $label = NULL)

No description

addMultiSelect(string $name, null $label = NULL, array $items = NULL, null $size = NULL)

No description

addMultiUpload(string $name, string $label = NULL)

No description

addPassword(string $name, string $label = NULL, null $cols = NULL, null $maxLength = NULL)

No description

addRadioList($name, $label = NULL, array $items = NULL)

No description

addSelect(string $name, string $label = NULL, array $items = NULL, null $size = NULL)

No description

addSubmit(string $name, string $caption = NULL, string $btnClass = 'btn-primary')

No description

addText(string $name, string $label = NULL, null $cols = NULL, null $maxLength = NULL)

No description

addTextArea(string $name, string $label = NULL, null $cols = NULL, null $rows = NULL)

No description

addUpload(string $name, string $label = NULL, bool $multiple = FALSE)

No description

addRow(string|null $name = NULL)

Adds a new Grid system row.

__construct(int| IContainer |null $container = NULL)

BootstrapForm constructor.

getElementPrototype()

No description

BootstrapRenderer | IFormRenderer
getRenderer()

No description

setRenderer( IFormRenderer $renderer = NULL)

No description

int
getRenderMode()

No description

bool
isAjax()

No description

bool
isAutoShowValidation()

No description

setAutoShowValidation(bool $autoShowValidation)

No description

bool
isShowValidation()

If valid fields should explicitly be green

setShowValidation(bool $showValidation)

If valid fields should explicitly be green

setAjax(bool $isAjax = TRUE)

No description

setRenderMode(int $renderMode)

No description

Details

ButtonInput addButton(string $name, null|string| Html $content = NULL, string $btnClass = 'btn-secondary')

Parameters

string $name
null|string| Html $content
string $btnClass secondary button class (primary is 'btn')

Return Value

ButtonInput

CheckboxInput addCheckbox(string $name, null $caption = NULL)

Parameters

string $name
null $caption

Return Value

CheckboxInput

CheckboxListInput addCheckboxList(string $name, null $label = NULL, array $items = NULL)

Parameters

string $name
null $label
array $items

Return Value

CheckboxListInput

abstract addComponent( IComponent $component, $name, $insertBefore = NULL)

Parameters

IComponent $component
$name
$insertBefore

BootstrapContainer addContainer(string $name)

Parameters

string $name

Return Value

BootstrapContainer

DateTimeInput addDateTime(string $name, string $label)

Adds a datetime input.

Parameters

string $name name
string $label label

Return Value

DateTimeInput

TextInput addEmail($name, null $label = NULL)

Parameters

$name
null $label

Return Value

TextInput

addInputError(string $componentName, string $message)

Adds error to a specific component

Parameters

string $componentName
string $message

TextInput addInteger(string $name, string $label = NULL)

Parameters

string $name
string $label

Return Value

TextInput

MultiselectInput addMultiSelect(string $name, null $label = NULL, array $items = NULL, null $size = NULL)

Parameters

string $name
null $label
array $items
null $size

Return Value

MultiselectInput

UploadInput addMultiUpload(string $name, string $label = NULL)

Parameters

string $name
string $label

Return Value

UploadInput

TextInput addPassword(string $name, string $label = NULL, null $cols = NULL, null $maxLength = NULL)

Parameters

string $name
string $label
null $cols
null $maxLength

Return Value

TextInput

addRadioList($name, $label = NULL, array $items = NULL)

Parameters

$name
$label
array $items

SelectInput addSelect(string $name, string $label = NULL, array $items = NULL, null $size = NULL)

Parameters

string $name
string $label
array $items
null $size ignore

Return Value

SelectInput

SubmitButtonInput addSubmit(string $name, string $caption = NULL, string $btnClass = 'btn-primary')

Parameters

string $name
string $caption
string $btnClass secondary button class (primary is 'btn')

Return Value

SubmitButtonInput

TextInput addText(string $name, string $label = NULL, null $cols = NULL, null $maxLength = NULL)

Parameters

string $name
string $label
null $cols ignored
null $maxLength ignored

Return Value

TextInput

TextAreaInput addTextArea(string $name, string $label = NULL, null $cols = NULL, null $rows = NULL)

Parameters

string $name
string $label
null $cols ignored
null $rows ignored

Return Value

TextAreaInput

UploadInput addUpload(string $name, string $label = NULL, bool $multiple = FALSE)

Parameters

string $name
string $label
bool $multiple

Return Value

UploadInput

in AddRowTrait at line 24
BootstrapRow addRow(string|null $name = NULL)

Adds a new Grid system row.

Parameters

string|null $name optional. If null is passed, it is generated.

Return Value

BootstrapRow

at line 60
__construct(int| IContainer |null $container = NULL)

BootstrapForm constructor.

Parameters

int| IContainer |null $container

at line 80
getElementPrototype()

at line 88
BootstrapRenderer | IFormRenderer getRenderer()

Return Value

BootstrapRenderer | IFormRenderer

at line 97
BootstrapForm setRenderer( IFormRenderer $renderer = NULL)

Parameters

IFormRenderer $renderer

Return Value

BootstrapForm

at line 110
int getRenderMode()

Return Value

int

at line 118
bool isAjax()

Return Value

bool if form is ajax. True by default.

at line 126
bool isAutoShowValidation()

Return Value

bool

at line 135
BootstrapForm setAutoShowValidation(bool $autoShowValidation)

Parameters

bool $autoShowValidation

Return Value

BootstrapForm

at line 146
bool isShowValidation()

If valid fields should explicitly be green

Return Value

bool

at line 156
BootstrapForm setShowValidation(bool $showValidation)

If valid fields should explicitly be green

Parameters

bool $showValidation

Return Value

BootstrapForm

at line 167
BootstrapForm setAjax(bool $isAjax = TRUE)

Parameters

bool $isAjax

Return Value

BootstrapForm

at line 191
BootstrapForm setRenderMode(int $renderMode)

Parameters

int $renderMode

Return Value

BootstrapForm