FormTabs

Form Tabs definition A translation of the form field tab configuration

 class Backend\Classes\FormTabs
implements 
    IteratorAggregate,
    ArrayAccess

Constants

Constant Description
SECTION_OUTSIDE
string "outside"
SECTION_PRIMARY
string "primary"
SECTION_SECONDARY
string "secondary"

Properties

public $cssClass : string

Specifies a CSS class to attach to the tab container.

public $defaultTab : string

Default tab label to use when none is specified.

public $fields : array

Collection of panes fields to these tabs.

public $icons : array

List of icons for their corresponding tabs.

public $lazy : array

Names of tabs to lazy load.

public $linkable : bool

Each tab gets url fragment to be linkable.

public $paneCssClass : array

Specifies a CSS class to an individual tab pane.

public $section : string

Specifies the form section these tabs belong to.

public $stretch : bool

Should these tabs stretch to the bottom of the page layout.

public $suppressTabs : bool

If set to TRUE, fields will not be displayed in tabs.

Methods

public __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
Property Description
$section
string

Specifies a section as described above.

$config
array

A list of render mode specific config.

Returns
mixed

public addField (string $name, Backend\Classes\FormField $field, string $tab = null)

Add a field to the collection of tabs.

Parameters
Property Description
$name
string
$field
Backend\Classes\FormField
$tab
string
Returns
mixed

public getAllFields () : array

Returns an array of the registered fields, without tabs.

Returns
array

public getFields () : array

Returns an array of the registered fields, including tabs.

Returns
array

public getIcon (string $name) : string

Returns an icon for the tab based on the tab's name.

Parameters
Property Description
$name
string
Returns
string

public getIterator () : Traversable

Get an iterator for the items.

Returns
Traversable

public getPaneCssClass (string $index = null, string $label = null) : string

Returns a tab pane CSS class.

Parameters
Property Description
$index
string
$label
string
Returns
string

public hasFields () : bool

Returns true if any fields have been registered for these tabs

Returns
bool

public offsetExists ($offset) : bool

ArrayAccess implementation

Parameters
Property Description
$offset
mixed
Returns
bool

public offsetGet ($offset)

ArrayAccess implementation

Parameters
Property Description
$offset
mixed
Returns
mixed

public offsetSet ($offset, $value) : void

ArrayAccess implementation

Parameters
Property Description
$offset
mixed
$value
mixed
Returns
void

public offsetUnset ($offset) : void

ArrayAccess implementation

Parameters
Property Description
$offset
mixed
Returns
void

public removeField (string $name) : bool

Remove a field from all tabs by name.

Parameters
Property Description
$name
string
Returns
bool

protected evalConfig (array $config) : array

Process options and apply them to this object.

Parameters
Property Description
$config
array
Returns
array
Copyright © 2024 Winter CMS