MenuController.php in Zircon Profile 8
File
core/modules/menu_link_content/src/Controller/MenuController.php
View source
<?php
namespace Drupal\menu_link_content\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\system\MenuInterface;
class MenuController extends ControllerBase {
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);
}
}
Classes
Name |
Description |
MenuController |
Defines a route controller for a form for menu link content entity creation. |