function field_group_get_context_from_display in Field Group 8.3
Same name and namespace in other branches
- 8 includes/field_ui.inc \field_group_get_context_from_display()
Helper function to get context from entity display.
Parameters
\Drupal\Core\Entity\EntityDisplayBase $display:
Return value
string
3 calls to field_group_get_context_from_display()
- field_group_field_overview_submit in includes/
field_ui.inc - Submit handler for the overview screens.
- field_group_field_ui_display_form_alter in includes/
field_ui.inc - Function to alter the display overview screens.
- field_group_field_ui_form_params in includes/
field_ui.inc - Helper function to get the form parameters to use while building the fields and display overview form.
File
- includes/
field_ui.inc, line 88 - Field_group.field_ui.inc is a file that contains most functions needed on the Fields UI Manage forms (display and fields).
Code
function field_group_get_context_from_display(EntityDisplayBase $display) {
if ($display instanceof EntityFormDisplayInterface) {
return 'form';
}
elseif ($display instanceof EntityViewDisplayInterface) {
return 'view';
}
throw new LogicException('Unknown display object.');
}