O'Reilly logo

Drupal 8 Module Development by Daniel Sipos

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Menu links

At their most basic level, menu links are plugins, but this time discoverable via a YAML discovery (instead of annotations like we are used to). To this end, the regular menu links are defined inside a module_name.links.menu.yml file and can be altered by other modules by implementing hook_menu_links_discovered_alter(). When I say regular, I mean those links that take you to menus. We will see next that there are also a few other types.

One of the reasons for the YAML discovery is that links are more definition than functionality, so they don't necessarily require classes, but can be represented through some lines inside a YAML file.

There are some important classes you should check out in this architecture--MenuLinkManager (the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required