final class Helpers

Forms helpers.

Constants

private UnsafeNames

Methods

static FileUpload|null
extractHttpData(array $data, string $htmlName, int $type)

Extracts and sanitizes submitted form data for single control.

static string
generateHtmlName(string $id)

Converts a component path (e.g. 'form-person-name') to the HTML name attribute format (e.g. 'person[name]').

static array
exportRules(Rules $rules)

Exports validation rules into a JSON-serializable structure for the data-nette-rules attribute.

static string
createInputList(array $items, array|null $inputAttrs = null, array|null $labelAttrs = null, Html|string|null $wrapper = null)

Generates an HTML list of labeled inputs (radio buttons or checkboxes).

static Html
createSelectBox(array $items, array|null $optionAttrs = null, mixed $selected = null)

Generates a HTML element from the items array.

Parameters

array $items
array|null $optionAttrs
mixed $selected

Return Value

Html

at line 298
static int iniGetSize(string $name)

internal  
 

No description

Parameters

string $name

Return Value

int

at line 316
static string|null getSingleType(ReflectionParameter|ReflectionProperty $reflection)

internal  
 

Returns the single type name from reflection, or null if no type is defined.

Parameters

ReflectionParameter|ReflectionProperty $reflection

Return Value

string|null

at line 332
static mixed tryEnumConversion(mixed $value, ReflectionParameter|ReflectionProperty|null $reflection)

internal  
 

No description

Parameters

mixed $value
ReflectionParameter|ReflectionProperty|null $reflection

Return Value

mixed

at line 353
static array getSupportedImages()

internal  
 

No description

Return Value

array

Traits

StaticClass