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 mapping to the /hello path. Let's now create a link to that path which goes inside the main menu that is shipped 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 in it:
hello_world.hello:
title...