You are here

google_tag.routing.yml in GoogleTagManager 8

File

google_tag.routing.yml
View source
  1. # default settings
  2. google_tag.settings_form:
  3. path: '/admin/config/system/google-tag/settings'
  4. defaults:
  5. _title: 'Google Tag Manager settings'
  6. _form: '\Drupal\google_tag\Form\SettingsForm'
  7. requirements:
  8. _permission: 'administer google tag manager'
  9. # container management
  10. entity.google_tag_container.collection:
  11. path: '/admin/config/system/google-tag'
  12. defaults:
  13. #_title: 'Google Tag Manager'
  14. #_form: '\Drupal\google_tag\Form\ContainerListBuilder'
  15. _entity_list: 'google_tag_container'
  16. _title: 'Google Tag Manager containers'
  17. requirements:
  18. _permission: 'administer google tag manager'
  19. entity.google_tag_container.add_form:
  20. path: '/admin/config/system/google-tag/add'
  21. defaults:
  22. #_title_arguments are only used with a _title..go figure
  23. #see Drupal\Core\Controller\TitleResolver->getTitle()
  24. #with a _title_callback
  25. #Drupal\Core\Controller\ControllerResolver::doGetArguments()
  26. #expects the argument to be top level in this defaults array
  27. _entity_form: 'google_tag_container'
  28. _title: 'Add Google Tag container'
  29. #_title_arguments:
  30. #entity_type_id: 'entity.google_tag_container'
  31. _title_callback: '\Drupal\google_tag\ContainerController::addTitle'
  32. entity_type_id: 'google_tag_container' # 'entity.google_tag_container argument'
  33. requirements:
  34. _permission: 'administer google tag manager'
  35. #the next two require the method parameter to be named google_tag_container
  36. entity.google_tag_container.enable:
  37. path: '/admin/config/system/google-tag/manage/{google_tag_container}/enable'
  38. defaults:
  39. _controller: '\Drupal\google_tag\ContainerController::enable'
  40. entity_type: 'google_tag_container'
  41. requirements:
  42. _permission: 'administer google tag manager'
  43. entity.google_tag_container.disable:
  44. path: '/admin/config/system/google-tag/manage/{google_tag_container}/disable'
  45. defaults:
  46. _controller: '\Drupal\google_tag\ContainerController::disable'
  47. entity_type: 'google_tag_container'
  48. requirements:
  49. _permission: 'administer google tag manager'
  50. #according to documentation this should work but does not
  51. #https://www.drupal.org/docs/8/api/routing-system/parameter-upcasting-in-routes
  52. #entity.google_tag_container.disable:
  53. #path: '/admin/config/system/google-tag/manage/{container}/disable'
  54. #defaults:
  55. #_controller: '\Drupal\google_tag\ContainerController::disable'
  56. #entity_type: 'google_tag_container'
  57. #requirements:
  58. #_permission: 'administer google tag manager'
  59. #options:
  60. #parameters:
  61. #container:
  62. #type: entity:google_tag_container
  63. entity.google_tag_container.edit_form:
  64. path: '/admin/config/system/google-tag/manage/{google_tag_container}'
  65. defaults:
  66. _entity_form: google_tag_container
  67. _title_callback: '\Drupal\google_tag\ContainerController::editTitle'
  68. requirements:
  69. _permission: 'administer google tag manager'
  70. entity.google_tag_container.delete_form:
  71. path: '/admin/config/system/google-tag/manage/{google_tag_container}/delete'
  72. defaults:
  73. _entity_form: 'google_tag_container.delete'
  74. requirements:
  75. _permission: 'administer google tag manager'