function menu_ui_entity_type_build
Same name in other branches
- 9 core/modules/menu_ui/menu_ui.module \menu_ui_entity_type_build()
- 10 core/modules/menu_ui/menu_ui.module \menu_ui_entity_type_build()
- 11.x core/modules/menu_ui/menu_ui.module \menu_ui_entity_type_build()
Implements hook_entity_type_build().
File
-
core/
modules/ menu_ui/ menu_ui.module, line 64
Code
function menu_ui_entity_type_build(array &$entity_types) {
/** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
$entity_types['menu']->setFormClass('add', 'Drupal\\menu_ui\\MenuForm')
->setFormClass('edit', 'Drupal\\menu_ui\\MenuForm')
->setFormClass('delete', 'Drupal\\menu_ui\\Form\\MenuDeleteForm')
->setListBuilderClass('Drupal\\menu_ui\\MenuListBuilder')
->setLinkTemplate('add-form', '/admin/structure/menu/add')
->setLinkTemplate('delete-form', '/admin/structure/menu/manage/{menu}/delete')
->setLinkTemplate('edit-form', '/admin/structure/menu/manage/{menu}')
->setLinkTemplate('add-link-form', '/admin/structure/menu/manage/{menu}/add')
->setLinkTemplate('collection', '/admin/structure/menu');
if (isset($entity_types['node'])) {
$entity_types['node']->addConstraint('MenuSettings', []);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.