function field_group_pre_render in Field Group 8.3
Same name and namespace in other branches
- 8 field_group.module \field_group_pre_render()
- 7.2 field_group.module \field_group_pre_render()
- 7 field_group.module \field_group_pre_render()
Function to pre render the field group element.
Parameters
$element: Render array of group element that needs to be created.
$group: Object with the group information.
$rendering_object: The entity / form beïng rendered.
See also
2 calls to field_group_pre_render()
- field_group_fields_nest in ./
field_group.module - Nests all the fields in the field groups.
- field_group_field_layout_fields_nest in ./
field_group.module - Nests all the fields in the field groups.
File
- ./
field_group.module, line 813 - Allows administrators to attach field groups.
Code
function field_group_pre_render(&$element, $group, &$rendering_object) {
// Only run the pre_render function if the group has elements.
// $group->group_name.
if ($element == [] && empty($group->format_settings['show_empty_fields'])) {
return;
}
// Let modules define their wrapping element.
// Note that the group element has no properties, only elements.
foreach (Drupal::moduleHandler()
->getImplementations('field_group_pre_render') as $module) {
// The intention here is to have the opportunity to alter the
// elements, as defined in hook_field_group_formatter_info.
// Note, implement $element by reference!
$function = $module . '_field_group_pre_render';
$function($element, $group, $rendering_object);
}
// Allow others to alter the pre_render.
Drupal::moduleHandler()
->alter('field_group_pre_render', $element, $group, $rendering_object);
}