public function MenuController::addLink in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/menu_link_content/src/Controller/MenuController.php \Drupal\menu_link_content\Controller\MenuController::addLink()
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.
1 string reference to 'MenuController::addLink'
- menu_link_content.routing.yml in core/
modules/ menu_link_content/ menu_link_content.routing.yml - core/modules/menu_link_content/menu_link_content.routing.yml
File
- core/
modules/ menu_link_content/ src/ Controller/ MenuController.php, line 27 - Contains \Drupal\menu_link_content\Controller\MenuController.
Class
- MenuController
- Defines a route controller for a form for menu link content entity creation.
Namespace
Drupal\menu_link_content\ControllerCode
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);
}