Every Form consists of Field Groups that contain Field Sets. The below covers everything about Field Groups and how they work with Field Sets.
When working with Field Groups, you’ll always request it from the
CP\Form object to request it, initially. Once you have a Field Group, you’ll decorate it like everything else. For example:
$form = ee('CP/Form'); $field_group = $form->getGroup('General Settings');
In the above,
$field_group will contain our Field object. Once we have it, we can start adding Field Sets to it and really craft our Form.
$field_set = $field_group->getFieldSet('First Name');
If your Form object is set to be a Tabbed form, it’s the Groups that make up the Tab layer
The Group object consists of only a couple methods of use.
Returns the name used upon creation for the Field Group.
||The raw value used|
Returns the entire
CP\Form\Group object into an array. Note that all child elements are converted to an array as well.
||The Group as an array|
Will return the Field Group if it exists, or prepare and return a new Field Group. See
Field Sets for more details.
||The name for the Field Set|
||A Field Set object ready for use|
Removes the specified Field Set from the Form Group
||The name used for the Field Set|