-
Notifications
You must be signed in to change notification settings - Fork 1
Repeater field
Loïc Antignac edited this page Aug 4, 2022
·
3 revisions

The repeater field is simply used to repeat a field or a group of fields.
The declaration of this field is quite simple:
[
'slug' => 'wax_company_settings_social_networks',
'type' => 'repeater',
'labels' => [
'label' => 'social_networks_label',
'help' => '',
],
'children' => [
[
'slug' => 'wax_company_settings_network_name',
'type' => 'text',
'labels' => [
'label' => 'network_name_label',
'help' => 'network_name_help',
],
],
[
'slug' => 'wax_company_settings_network_display',
'type' => 'checkbox',
'args' => [],
'labels' => [
'label' => 'network_display_label',
'help' => 'network_display_help',
],
],
[
'slug' => 'wax_company_settings_network_logo',
'type' => 'image',
'args' => [],
'labels' => [
'label' => 'the_network_photo_label',
'help' => '',
],
],
],
],The labels key contains the keys for retrieving the labels from the labels array as for every field.