Now that we know how to load and manipulate trees of menu links, let's talk a bit more about the regular menu links. In this section, we will look at how our module can define menu links and how we can work with them programmatically once we get our hands on them from a tree or somewhere else.
Working with menu links
Defining menu links
In our "Hello World" module, we defined a couple of routes, one of which is the /hello path, which shows our themed salutation component. Let's create a link to that path that goes in the main menu that comes with Drupal core.
As I mentioned, menu links are defined inside a *.links.menu.yml file. So, let's create that file for our module and add our menu link definition...