Documentation

Fields
in package

Management of input fields.

Tags
author

Partydragen

version
2.0.0-pr13
license

MIT

Table of Contents

Constants

CHECKBOX  = 9
DATE  = 3
EMAIL  = 7
NUMBER  = 6
PASSWORD  = 4
RADIO  = 8
SELECT  = 5
TEXT  = 1
TEXTAREA  = 2

Properties

$_fields  : array<string|int, mixed>

Methods

add()  : void
Add a field to this fields instance.
addOption()  : void
Add a option to a field.
getAll()  : array<string|int, mixed>
List all fields, sorted by their order.

Constants

CHECKBOX

public mixed CHECKBOX = 9

PASSWORD

public mixed PASSWORD = 4

TEXTAREA

public mixed TEXTAREA = 2

Properties

$_fields

private array<string|int, mixed> $_fields = []

Array of all the registered fields.

Methods

add()

Add a field to this fields instance.

public add(string $key, int $type, string $label[, bool $required = false ][, string|array<string|int, mixed> $value = '' ][, string|null $placeholder = null ][, string|null $info = null ][, int|null $order = null ]) : void
Parameters
$key : string

Unique name for the field item.

$type : int

Field type.

$label : string

The label for this field.

$required : bool = false

Require user to fill this field.

$value : string|array<string|int, mixed> = ''

Default value for this field.

$placeholder : string|null = null

Field placeholder.

$info : string|null = null

Field information.

$order : int|null = null

Field order.

addOption()

Add a option to a field.

public addOption(string $field, string $value, string $option) : void
Parameters
$field : string

Add the option to this field.

$value : string

Field value.

$option : string

The option to display.

getAll()

List all fields, sorted by their order.

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

List of fields.


        
On this page

Search results