class FormTabs implements IteratorAggregate, ArrayAccess

Form Tabs definition A translation of the form field tab configuration

Adapted from october\backend\class\FormTabs

Constants

SECTION_OUTSIDE

SECTION_PRIMARY

Properties

string $section
array $fields
string $defaultTab
bool $stretch
bool $suppressTabs
string $cssClass

Methods

__construct(string $section, array $config = [])

Constructor.

array
evalConfig(array $config)

Process options and apply them to this object.

addField(string $name, FormField $field, string $tab = null)

Add a field to the collection of tabs.

bool
removeField(string $name)

Remove a field from all tabs by name.

bool
hasFields()

Returns true if any fields have been registered for these tabs

array
getFields()

Returns an array of the registered fields, including tabs.

array
getAllFields()

Returns an array of the registered fields, without tabs.

getIterator()

Get an iterator for the items.

offsetSet(mixed $offset, mixed $value)

ArrayAccess implementation

bool
offsetExists(mixed $offset)

ArrayAccess implementation

offsetUnset(mixed $offset)

ArrayAccess implementation

mixed|null
offsetGet(mixed $offset)

ArrayAccess implementation

Details

at line 61
__construct(string $section, array $config = [])

Constructor.

Specifies a tabs rendering section. Supported sections are:

  • outside - stores a section of "tabless" fields.
  • primary - tabs section for primary fields.
  • secondary - tabs section for secondary fields.

Parameters

string $section

Specifies a section as described above.

array $config

A list of render mode specific config.

at line 78
protected array evalConfig(array $config)

Process options and apply them to this object.

Parameters

array $config

Return Value

array

at line 104
addField(string $name, FormField $field, string $tab = null)

Add a field to the collection of tabs.

Parameters

string $name
FormField $field
string $tab

at line 120
bool removeField(string $name)

Remove a field from all tabs by name.

Parameters

string $name

Return Value

bool

at line 146
bool hasFields()

Returns true if any fields have been registered for these tabs

Return Value

bool

at line 155
array getFields()

Returns an array of the registered fields, including tabs.

Return Value

array

at line 164
array getAllFields()

Returns an array of the registered fields, without tabs.

Return Value

array

at line 179
ArrayIterator getIterator()

Get an iterator for the items.

Return Value

ArrayIterator

at line 193
offsetSet(mixed $offset, mixed $value)

ArrayAccess implementation

Parameters

mixed $offset
mixed $value

at line 205
bool offsetExists(mixed $offset)

ArrayAccess implementation

Parameters

mixed $offset

Return Value

bool

at line 215
offsetUnset(mixed $offset)

ArrayAccess implementation

Parameters

mixed $offset

at line 227
mixed|null offsetGet(mixed $offset)

ArrayAccess implementation

Parameters

mixed $offset

Return Value

mixed|null