You are here

flags_ui.routing.yml in Flags 8

flags_ui/flags_ui.routing.yml

File

flags_ui/flags_ui.routing.yml
View source
  1. flags.menu:
  2. path: '/admin/config/regional/flags'
  3. defaults:
  4. _controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
  5. _title: 'Flags'
  6. requirements:
  7. _permission: 'administer flag mapping'
  8. # This is the router item for listing all entities.
  9. entity.country_flag_mapping.list:
  10. path: '/admin/config/regional/flags/countries'
  11. defaults:
  12. # '_entity_list' tells Drupal to use an entity list controller.
  13. # We give the entity ID here. Drupal then looks in the entity's annotation
  14. # and looks for the "list" entry under "controllers" for the class to load.
  15. # @see \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer
  16. _entity_list: 'country_flag_mapping'
  17. _title: 'Flag mappings for countries'
  18. requirements:
  19. _permission: 'administer flag mapping'
  20. # This is the router item for adding our entity.
  21. entity.country_flag_mapping.add_form:
  22. path: '/admin/config/regional/flags/countries/add'
  23. defaults:
  24. _title: 'Add flag mapping for country'
  25. # Like _entity_list above, _entity_form gives the entity type ID, only this
  26. # time also lists the form separated by a period. Drupal looks in the
  27. # annotation for the entity and locates the "add" entry under "form" for
  28. # the form class to load.
  29. # @see \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer
  30. _entity_form: country_flag_mapping.add
  31. requirements:
  32. _entity_create_access: country_flag_mapping
  33. # This is the router item for editing our entity.
  34. entity.country_flag_mapping.edit_form:
  35. # Parameters may be passed to the form via the URL path. We name the
  36. # parameter in the path by enclosing it in curly braces. For entity forms,
  37. # we include the entity ID in the path by including a parameter with the
  38. # same name as the entity type ID.
  39. path: '/admin/config/regional/flags/countries/{country_flag_mapping}'
  40. defaults:
  41. _title: 'Edit flag mapping for country'
  42. # List our add entry above, this _entity_form entry instructs Drupal to
  43. # read our entity type's annonation, and look for the "edit" entry under
  44. # "form".
  45. _entity_form: country_flag_mapping.edit
  46. requirements:
  47. # This uses our entity access controller.
  48. # @see \Drupal\Core\Entity\EntityAccessCheck
  49. _entity_access: country_flag_mapping.update
  50. # This is the router item for deleting an instance of our entity.
  51. entity.country_flag_mapping.delete_form:
  52. path: '/admin/config/regional/flags/countries/{country_flag_mapping}/delete'
  53. defaults:
  54. _title: 'Delete flag mapping for country'
  55. _entity_form: country_flag_mapping.delete
  56. requirements:
  57. _entity_access: country_flag_mapping.delete
  58. # The routing.yml file defines the paths for our module.
  59. # Here we define the paths for our entity type's admin UI.
  60. # This is the router item for listing all entities.
  61. entity.language_flag_mapping.list:
  62. path: '/admin/config/regional/flags/languages'
  63. defaults:
  64. # '_entity_list' tells Drupal to use an entity list controller.
  65. # We give the entity ID here. Drupal then looks in the entity's annotation
  66. # and looks for the "list" entry under "controllers" for the class to load.
  67. # @see \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer
  68. _entity_list: 'language_flag_mapping'
  69. _title: 'Flag mapping for languages'
  70. requirements:
  71. _permission: 'administer flag mapping'
  72. # This is the router item for adding our entity.
  73. entity.language_flag_mapping.add_form:
  74. path: '/admin/config/regional/flags/languages/manage/add'
  75. defaults:
  76. _title: 'Add flag mapping'
  77. # Like _entity_list above, _entity_form gives the entity type ID, only this
  78. # time also lists the form separated by a period. Drupal looks in the
  79. # annotation for the entity and locates the "add" entry under "form" for
  80. # the form class to load.
  81. # @see \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer
  82. _entity_form: language_flag_mapping.add
  83. requirements:
  84. _entity_create_access: language_flag_mapping
  85. # This is the router item for editing our entity.
  86. entity.language_flag_mapping.edit_form:
  87. # Parameters may be passed to the form via the URL path. We name the
  88. # parameter in the path by enclosing it in curly braces. For entity forms,
  89. # we include the entity ID in the path by including a parameter with the
  90. # same name as the entity type ID.
  91. path: '/admin/config/regional/flags/languages/manage/{language_flag_mapping}'
  92. defaults:
  93. _title: 'Edit flag mapping'
  94. # List our add entry above, this _entity_form entry instructs Drupal to
  95. # read our entity type's annonation, and look for the "edit" entry under
  96. # "form".
  97. _entity_form: language_flag_mapping.edit
  98. requirements:
  99. # This uses our entity access controller.
  100. # @see \Drupal\Core\Entity\EntityAccessCheck
  101. _entity_access: language_flag_mapping.update
  102. # This is the router item for deleting an instance of our entity.
  103. entity.language_flag_mapping.delete_form:
  104. path: '/admin/config/regional/flags/languages/manage/{language_flag_mapping}/delete'
  105. defaults:
  106. _title: 'Delete flag mapping'
  107. _entity_form: language_flag_mapping.delete
  108. requirements:
  109. _entity_access: language_flag_mapping.delete