This question already has an answer here:

I have a my_module.routing.yml file and because of I have multi entity in my module its too big and not pretty.

Is there any way to split it for each entity and include them in one file like symfony, I use below code but it's not work in drupal 8.

  resource: "@acmeDemoBundle/Resources/config/routing/user_routing.yml"

I also use absolute path for yml file but it's not work.

marked as duplicate by leymannx, kiamlaluno Dec 28 '18 at 7:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Use DefaultHtmlRouteProvider or extend this class to customize the routes. – 4k4 Dec 27 '18 at 10:15
  • tnx @4k4 I see this but is there any way with yaml file? – sadeghpro Dec 27 '18 at 12:04
  • No, the code to discover those yaml files is Drupal specific, so the Symfony docs are not valid here, see Drupal\Core\Routing\RouteBuilder – 4k4 Dec 27 '18 at 12:16
  • This post says that you can split routing.yml in multiple files, or you can do something a little bit alternate. – Victor F Dec 27 '18 at 19:13

Browse other questions tagged or ask your own question.