public MenuController::addLink(MenuInterface $menu)
Provides the menu link creation form.
Parameters
\Drupal\system\MenuInterface $menu: An entity representing a custom menu.
Return value
array Returns the menu link creation form.
File
- core/modules/menu_link_content/src/Controller/MenuController.php, line 22
Class
- MenuController
- Defines a route controller for a form for menu link content entity creation.
Namespace
Drupal\menu_link_content\Controller
Code
public function addLink(MenuInterface $menu) { $menu_link = $this->entityManager()->getStorage('menu_link_content')->create(array( 'id' => '', 'parent' => '', 'menu_name' => $menu->id(), 'bundle' => 'menu_link_content', )); return $this->entityFormBuilder()->getForm($menu_link); }
Please login to continue.