function field_layout_entity_type_alter
Same name in other branches
- 9 core/modules/field_layout/field_layout.module \field_layout_entity_type_alter()
- 10 core/modules/field_layout/field_layout.module \field_layout_entity_type_alter()
- 11.x core/modules/field_layout/field_layout.module \field_layout_entity_type_alter()
Implements hook_entity_type_alter().
File
-
core/
modules/ field_layout/ field_layout.module, line 36
Code
function field_layout_entity_type_alter(array &$entity_types) {
/** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
$entity_types['entity_view_display']->setClass(FieldLayoutEntityViewDisplay::class);
$entity_types['entity_form_display']->setClass(FieldLayoutEntityFormDisplay::class);
// The form classes are only needed when Field UI is installed.
if (\Drupal::moduleHandler()->moduleExists('field_ui')) {
$entity_types['entity_view_display']->setFormClass('edit', FieldLayoutEntityViewDisplayEditForm::class);
$entity_types['entity_form_display']->setFormClass('edit', FieldLayoutEntityFormDisplayEditForm::class);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.