config_entity_example.routing.yml

Same filename in other branches
  1. 3.x modules/config_entity_example/config_entity_example.routing.yml
  2. 8.x-1.x config_entity_example/config_entity_example.routing.yml
modules/config_entity_example/config_entity_example.routing.yml
4 string references to YAML keys in config_entity_example.routing.yml
ConfigEntityExampleTest::testConfigEntityExample in modules/config_entity_example/tests/src/Functional/ConfigEntityExampleTest.php
Various functional test of the Config Entity Example module.
RobotDeleteForm::getCancelUrl in modules/config_entity_example/src/Form/RobotDeleteForm.php
Gets the cancel URL.
RobotFormBase::save in modules/config_entity_example/src/Form/RobotFormBase.php
Overrides Drupal\Core\Entity\EntityFormController::save().
_examples_toolbar_routes in ./examples.module
Get a list of toolbar links for testing toolbar routes.

File

modules/config_entity_example/config_entity_example.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. entity.robot.list:
  5. path: '/examples/config-entity-example'
  6. defaults:
  7. # '_entity_list' tells Drupal to use an entity list controller. We give the
  8. # entity ID here.
  9. # Drupal then looks in the entity's annotation and looks for the "list"
  10. # entry under "controllers" for the class to load.
  11. # @see \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer
  12. _entity_list: robot
  13. _title: 'Config Entity Example'
  14. requirements:
  15. _permission: 'administer robots'
  16. # This is the router item for adding our entity.
  17. entity.robot.add_form:
  18. path: '/examples/config-entity-example/add'
  19. defaults:
  20. _title: 'Add robot'
  21. # Like _entity_list above, _entity_form gives the entity type ID, only this
  22. # time also lists the form separated by a period. Drupal looks in the
  23. # annotation for the entity and locates the "add" entry under "form" for
  24. # the form class to load.
  25. # @see \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer
  26. _entity_form: robot.add
  27. requirements:
  28. _entity_create_access: robot
  29. # This is the router item for editing our entity.
  30. entity.robot.edit_form:
  31. # Parameters may be passed to the form via the URL path. We name the
  32. # parameter in the path by enclosing it in curly braces. For entity forms,
  33. # we include the entity ID in the path by including a parameter with the
  34. # same name as the entity type ID.
  35. path: '/examples/config-entity-example/manage/{robot}'
  36. defaults:
  37. _title: 'Edit robot'
  38. # List our add entry above. This _entity_form entry instructs Drupal to
  39. # read our entity type's annotation and look for the "edit" entry under
  40. # "form".
  41. _entity_form: robot.edit
  42. requirements:
  43. # This uses our entity access controller.
  44. # @see \Drupal\Core\Entity\EntityAccessCheck
  45. _entity_access: robot.update
  46. # This is the router item for deleting an instance of our entity.
  47. entity.robot.delete_form:
  48. path: '/examples/config-entity-example/manage/{robot}/delete'
  49. defaults:
  50. _title: 'Delete robot'
  51. _entity_form: robot.delete
  52. requirements:
  53. _entity_access: robot.delete