class FormDisplayTemplate

PhpMyAdmin\Config\FormDisplayTemplate class

Properties

int $group
protected Config $config
Template $template

Methods

__construct(Config $config)

FormDisplayTemplate constructor.

string
displayFormTop(string $action = null, string $method = 'post', array|null $hiddenFields = null)

Displays top part of the form

string
displayTabsTop(array $tabs)

Displays form tabs which are given by an array indexed by fieldset id ({@link self::displayFieldsetTop}), with values being tab titles.

string
displayFieldsetTop(string $title = '', string $description = '', array|null $errors = null, array $attributes = [])

Displays top part of a fieldset

string
displayInput(string $path, string $name, string $type, mixed $value, string $description = '', bool $valueIsDefault = true, array|null $opts = null)

Displays input field

string
displayGroupHeader(string $headerText)

Display group header

void
displayGroupFooter()

Display group footer

string
displayFieldsetBottom(bool $showButtons = true)

Displays bottom part of a fieldset

string
displayTabsBottom()

Closes form tabs

string
displayFormBottom()

Displays bottom part of the form

void
addJsValidate(string $fieldId, string|array $validators, array $jsArray)

Appends JS validation code to $js_array

string
displayJavascript(array $jsArray)

Displays JavaScript code

string
displayErrors(string $name, array $errorList)

Displays error list

Details

at line 44
__construct(Config $config)

FormDisplayTemplate constructor.

Parameters

Config $config Config instance

at line 59
string displayFormTop(string $action = null, string $method = 'post', array|null $hiddenFields = null)

Displays top part of the form

Parameters

string $action default: $_SERVER['REQUEST_URI']
string $method 'post' or 'get'
array|null $hiddenFields array of form hidden fields (key: field name)

Return Value

string

at line 97
string displayTabsTop(array $tabs)

Displays form tabs which are given by an array indexed by fieldset id ({@link self::displayFieldsetTop}), with values being tab titles.

Parameters

array $tabs tab names

Return Value

string

at line 127
string displayFieldsetTop(string $title = '', string $description = '', array|null $errors = null, array $attributes = [])

Displays top part of a fieldset

Parameters

string $title title of fieldset
string $description description shown on top of fieldset
array|null $errors error messages to display
array $attributes optional extra attributes of fieldset

Return Value

string

at line 173
string displayInput(string $path, string $name, string $type, mixed $value, string $description = '', bool $valueIsDefault = true, array|null $opts = null)

Displays input field

$opts keys: o doc - (string) documentation link o errors - error array o setvalue - (string) shows button allowing to set predefined value o show_restore_default - (boolean) whether show "restore default" button o userprefs_allow - whether user preferences are enabled for this field (null - no support, true/false - enabled/disabled) o userprefs_comment - (string) field comment o values - key - value pairs for