You are here

search_autocomplete.routing.yml in Search Autocomplete 8

Same filename and directory in other branches
  1. 2.x search_autocomplete.routing.yml

File

search_autocomplete.routing.yml
View source
  1. # The routing.yml file defines the paths for our module.
  2. # Here we define the paths for our entity type's admin UI.
  3. # This is the router item for listing all entities.
  4. autocompletion_configuration.list:
  5. path: '/admin/config/search/search_autocomplete'
  6. defaults:
  7. # '_entity_list' tells Drupal to use an entity list controller.
  8. # We give the entity ID here. Drupal then looks in the entity's annotation
  9. # and looks for the "list" entry under "controllers" for the class to load.
  10. # @see \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer
  11. _entity_list: 'autocompletion_configuration'
  12. _title: 'Search Autocomplete settings'
  13. requirements:
  14. _permission: 'administer search autocomplete'
  15. # This is the router item for adding our entity.
  16. autocompletion_configuration.add:
  17. path: '/admin/config/search/search_autocomplete/add'
  18. defaults:
  19. _title: 'Add new Autocompletion Configuration'
  20. # Like _entity_list above, _entity_form gives the entity type ID, only this
  21. # time also lists the form separated by a period. Drupal looks in the
  22. # annotation for the entity and locates the "add" entry under "form" for
  23. # the form class to load.
  24. # @see \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer
  25. _entity_form: autocompletion_configuration.add
  26. requirements:
  27. _entity_create_access: autocompletion_configuration
  28. # This is the router item for editing our entity.
  29. entity.autocompletion_configuration.edit_form:
  30. # Parameters may be passed to the form via the URL path. We name the
  31. # parameter in the path by enclosing it in curly braces. For entity forms,
  32. # we include the entity ID in the path by including a parameter with the
  33. # same name as the entity type ID.
  34. path: '/admin/config/search/search_autocomplete/manage/{autocompletion_configuration}'
  35. defaults:
  36. _title: 'Edit Autocompletion Configuration'
  37. # List our add entry above, this _entity_form entry instructs Drupal to
  38. # read our entity type's annonation, and look for the "edit" entry under
  39. # "form".
  40. _entity_form: autocompletion_configuration.edit
  41. requirements:
  42. # This uses our entity access controller.
  43. # @see \Drupal\Core\Entity\EntityAccessCheck
  44. _entity_access: autocompletion_configuration.update
  45. # This is the router item for deleting an instance of our entity.
  46. entity.autocompletion_configuration.delete_form:
  47. path: '/admin/config/search/search_autocomplete/manage/{autocompletion_configuration}/delete'
  48. defaults:
  49. _title: 'Delete Autocompletion Configuration'
  50. _entity_form: autocompletion_configuration.delete
  51. requirements:
  52. _entity_access: autocompletion_configuration.delete
  53. # This is router for autocompletion callback to autocomplete the view.
  54. search_autocomplete.view_autocomplete:
  55. path: '/view_autocomplete'
  56. defaults:
  57. _controller: '\Drupal\search_autocomplete\Form\AutocompletionConfigurationEditForm::viewAutocomplete'
  58. requirements:
  59. _permission: 'administer search autocomplete'