Documentation

FormField extends SimpleModel
in package

A class implementing a RedBean model for Form beans

Tags
psalm-suppress

UnusedClass

Table of Contents

$attributes  : array<, string>
$flags  : array<, mixed>
$lcount  : int
doLabel()  : string
Handle a label
fieldAttr()  : string
Render a field's attributes

Properties

$attributes

private static array<, string> $attributes = ['class', 'name', 'placeholder']

Attributes that this supports

$flags

private static array<, mixed> $flags = ['checked' => ['Checked', TRUE, 0x1], 'disabled' => ['Disabled', FALSE, 0x2], 'multiple' => ['Multiple', TRUE, 0x4], 'readonly' => ['Readonly', FALSE, 0x8], 'required' => ['Required', FALSE, 0x10]]

The kinds of flags that fields can have

$lcount

private static int $lcount = 1

Counter used for generating new IDs

Methods

doLabel()

Handle a label

public doLabel([bool $makefor = TRUE ][, string $class = '' ][, string $inp = '' ]) : string
Parameters
$makefor : bool = TRUE

If TRUE then make a for attribute

$class : string = ''

The class name

$inp : string = ''

The input HTML

Return values
string

The field idval might be updated also

fieldAttr()

Render a field's attributes

public fieldAttr(string $class[, bool $doValue = TRUE ]) : string
Parameters
$class : string

The class name

$doValue : bool = TRUE

If TRUE Then add a value attribute

Return values
string

Search results