CoolCMS API

FormPairExtension extends Extension
in package

FinalYes

Latte extension registering the filter `|formPair` and the tag `{pair name}`.

  • {$form['name']|formPair|noescape} renders a control pair.
  • {pair name} is a shorthand that assumes a $form variable in the template.

Both render <input> followed by <label> without the outer <label class="form-check"> that CheckboxInput::getControl() produces by default.

Table of Contents

Methods

getFilters()  : array<string|int, mixed>
getTags()  : array<string|int, mixed>
parsePairTag()  : FragmentNode
renderControlPair()  : string
renderFormPair()  : string
html()  : string
Normalizes a form control part: it is `Html`, sometimes a bare string (already HTML), or nothing.
renderCheckboxPair()  : string

Methods

getFilters()

public getFilters() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTags()

public getTags() : array<string|int, mixed>
Return values
array<string|int, mixed>

parsePairTag()

public parsePairTag(Tag $tag) : FragmentNode
Parameters
$tag : Tag
Return values
FragmentNode

renderControlPair()

public static renderControlPair(mixed $form, string $name) : string
Parameters
$form : mixed
$name : string
Return values
string

renderFormPair()

public static renderFormPair(BaseControl $control) : string
Parameters
$control : BaseControl
Return values
string

html()

Normalizes a form control part: it is `Html`, sometimes a bare string (already HTML), or nothing.

private static html(mixed $part) : string
Parameters
$part : mixed
Return values
string

renderCheckboxPair()

private static renderCheckboxPair(CheckboxInput $control) : string
Parameters
$control : CheckboxInput
Return values
string
On this page

Search results