php_object_dsl.php 822 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Symfony\Component\Routing\Loader\Configurator;
  3. return new class() {
  4. public function __invoke(RoutingConfigurator $routes)
  5. {
  6. $routes
  7. ->collection()
  8. ->add('foo', '/foo')
  9. ->condition('abc')
  10. ->options(['utf8' => true])
  11. ->add('buz', 'zub')
  12. ->controller('foo:act');
  13. $routes->import('php_dsl_sub.php')
  14. ->prefix('/sub')
  15. ->requirements(['id' => '\d+']);
  16. $routes->import('php_dsl_sub.php')
  17. ->namePrefix('z_')
  18. ->prefix('/zub');
  19. $routes->import('php_dsl_sub_root.php')
  20. ->prefix('/bus', false);
  21. $routes->add('ouf', '/ouf')
  22. ->schemes(['https'])
  23. ->methods(['GET'])
  24. ->defaults(['id' => 0]);
  25. }
  26. };