1

I'm new to Drupal 8, and was curious why some modules have a *-routing.yml file, while others don't.

Why is this the case? Does this mean that modules lacking in a *-routing.yml file don't have any routing URLs?

  • 2
    There are other ways to provide routes beside routing file. The routing file is for static routes that you know you have. There is the \Drupal\Core\Entity\Routing\EntityRouteProviderInterface for example, which allows you to provide routes programmatically - so based on the configuration the routes will change - hence cannot be placed in the routing file. – user21641 Aug 14 '17 at 14:22
3

*.routing.yml is used to define custom endpoints and their receiving controllers. It's the config version for hook_menu in D8. If the module does not introduce custom paths, then it will not need one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.