Methods |
public
static
|
init()
Constructor
|
#
|
public
static
|
set(string $key, mixed $value = ''): void
Setter for the class properties
Setter for the class properties
Parameters
$key |
The property name
|
$value |
The value to be set
|
|
#
|
public
static
|
get(string $key, mixed $value = null): mixed
Getter for the class properties
Getter for the class properties
Parameters
$key |
The property name
|
$value |
The default value for the property
|
|
#
|
public
static
|
token(): void
Form token generation
|
#
|
public
static
|
validate(array $validations = null, array $data = []): boolean
Form token validation
Parameters
$validations |
The array of validation rules
|
$data |
The optional data array (if no value in $validation, it will be looked up in $data)
|
|
#
|
public
static
|
respond(string $formId, array $errors = null, bool $forceJson = false): void
AJAX form responder
Parameters
$formId |
The HTML form ID
|
$errors |
The array of the errors (it is used only for generic form processing)
|
$forceJson |
Send json header
|
|
#
|
public
static
|
value(string $name, mixed $defaultValue = null): mixed
Permits you to set the value of an input or textarea.
Allows you to safely use HTML and characters such as quotes…
Permits you to set the value of an input or textarea.
Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form
Parameters
$name |
The input element field name
|
$defaultValue |
The default value of the input element (optional)
|
Returns
The value of the input element
|
#
|
public
static
|
htmlValue(string $name, mixed $defaultValue = null): mixed
Permits you to set the value to a rich text editor or any input where HTML source is required to be rendered.
Allows…
Permits you to set the value to a rich text editor or any input where HTML source is required to be rendered.
Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form
Parameters
$name |
The input element field name
|
$defaultValue |
The default value of the input element (optional)
|
Returns
The value of the input element
|
#
|
public
static
|
selected(string $name, mixed $value, mixed $defaultValue = null): string
Allow you to select the option of a drop-down list.
Allow you to select the option of a drop-down list.
Parameters
$name |
The field name of the drop-down list
|
$value |
The option value to check against
|
$defaultValue |
The default selected value (optional)
|
Returns
'selected="selected"' if the option is found, otherwise the empty string returned
|
#
|
public
static
|
checked(string $name, mixed $value, mixed $defaultValue = null): string
Allow you to select a checkbox or a radio button
Allow you to select a checkbox or a radio button
Parameters
$name |
The field name of the checkbox or radio button
|
$value |
The value to check against
|
$defaultValue |
The default selected value (optional)
|
Returns
'checked="checked"' if the option is found, otherwise the empty string returned
|
#
|