php_dsl.php 860 B

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