public function MenuController::addLink in Config menu link 8
Provides the config menu link creation form.
Parameters
\Drupal\system\MenuInterface $menu: An entity representing a custom menu.
Return value
array Returns the menu link creation form.
1 string reference to 'MenuController::addLink'
File
- src/
Controller/ MenuController.php, line 24 - Contains \Drupal\menu_link_config\Controller\MenuController.
Class
Namespace
Drupal\menu_link_config\ControllerCode
public function addLink(MenuInterface $menu) {
$menu_link = $this
->entityTypeManager()
->getStorage('menu_link_config')
->create([
'id' => '',
'parent' => '',
'menu_name' => $menu
->id(),
'bundle' => 'menu_link_config',
]);
return $this
->entityFormBuilder()
->getForm($menu_link);
}