You are here

testing_example.routing.yml in Examples for Developers 3.x

modules/testing_example/testing_example.routing.yml

File

modules/testing_example/testing_example.routing.yml
View source
  1. # This route is to a page explaining the module.
  2. testing_example.description:
  3. path: '/examples/testing-example'
  4. defaults:
  5. _controller: '\Drupal\testing_example\Controller\TestingExampleController::description'
  6. requirements:
  7. _permission: 'access content'
  8. testing_example.simpletest_description:
  9. path: '/examples/testing-example/simpletest'
  10. defaults:
  11. _controller: '\Drupal\testing_example\Controller\TestingExampleController::simpletestDescription'
  12. requirements:
  13. _permission: 'access content'
  14. # This route displays a sum of two numbers in terms of how many hands are
  15. # required to count it.
  16. testing_example.sum_in_hands:
  17. path: '/examples/testing-example/sum-in-hands/{first}/{second}'
  18. defaults:
  19. _controller: '\Drupal\testing_example\Controller\ContrivedController::displayAddedNumbers'
  20. first: 23
  21. second: 77
  22. requirements:
  23. _permission: 'access content'
  24. first: '^[0-9]+'
  25. second: '^[0-9]+'