class DefaultFormRenderer implements FormRenderer

Converts a form into HTML output using a table-based layout configurable via the $wrappers array.

Properties

Html|string|null>> $wrappers

/--- form.container

protected $form
protected $counter

Methods

string
render(Form $form, string|null $mode = null)

Provides complete form rendering.

string
renderBegin()

Renders form begin.

string
renderEnd()

Renders form end.

string
renderErrors(Control|null $control = null, bool $own = true)

Renders validation errors (per form or per control).

string
renderBody()

Renders form body.

string
renderControls(ControlGroup $parent)

Renders group of controls.

string
renderPair(Control $control)

Renders single visual row.

string
renderPairMulti(array $controls)

Renders single visual row of multiple controls.

Html
renderLabel(Control $control)

Renders 'label' part of visual row of controls.

Html
renderControl(Control $control)

Renders 'control' part of visual row of controls.

Html|string|null
renderLabelElement(Control $control)

No description

Html|string
renderControlElement(Control $control)

No description

Html
getWrapper(string $name)

Returns a clone of the wrapper element specified by 'section key' (e.g. 'control errorcontainer').

mixed
getValue(string $name)

No description

Details

at line 128
string render(Form $form, string|null $mode = null)

Provides complete form rendering.

Parameters

Form $form
string|null $mode

'begin', 'errors', 'ownerrors', 'body', 'end' or empty to render all

Return Value

string

at line 159
string renderBegin()

Renders form begin.

Return Value

string

at line 193
string renderEnd()

Renders form end.

Return Value

string

at line 213
string renderErrors(Control|null $control = null, bool $own = true)

Renders validation errors (per form or per control).

Parameters

Control|null $control
bool $own

Return Value

string

at line 252
string renderBody()

Renders form body.

Return Value

string

at line 320
string renderControls(ControlGroup $parent)

Renders group of controls.

Parameters

ControlGroup $parent

Return Value

string

at line 362
string renderPair(Control $control)

Renders single visual row.

Parameters

Control $control

Return Value

string

at line 383
string renderPairMulti(array $controls)

Renders single visual row of multiple controls.

Parameters

array $controls

Return Value

string

at line 425
Html renderLabel(Control $control)

Renders 'label' part of visual row of controls.

Parameters

Control $control

Return Value

Html

at line 445
Html renderControl(Control $control)

Renders 'control' part of visual row of controls.

Parameters

Control $control

Return Value

Html

at line 501
protected Html|string|null renderLabelElement(Control $control)

No description

Parameters

Control $control

Return Value

Html|string|null

at line 507
protected Html|string renderControlElement(Control $control)

No description

Parameters

Control $control

Return Value

Html|string

at line 516
Html getWrapper(string $name)

Returns a clone of the wrapper element specified by 'section key' (e.g. 'control errorcontainer').

Parameters

string $name

Return Value

Html

at line 523
protected mixed getValue(string $name)

No description

Parameters

string $name

Return Value

mixed