validpattern.php 725 B

1234567891011121314151617181920212223
  1. <?php
  2. use Symfony\Component\Routing\RouteCollection;
  3. use Symfony\Component\Routing\Route;
  4. $collection = new RouteCollection();
  5. $collection->add('blog_show', new Route(
  6. '/blog/{slug}',
  7. array('_controller' => 'MyBlogBundle:Blog:show'),
  8. array('locale' => '\w+'),
  9. array('compiler_class' => 'RouteCompiler'),
  10. '{locale}.example.com',
  11. array('https'),
  12. array('GET','POST','put','OpTiOnS')
  13. ));
  14. $collection->add('blog_show_legacy', new Route(
  15. '/blog/{slug}',
  16. array('_controller' => 'MyBlogBundle:Blog:show'),
  17. array('_method' => 'GET|POST|put|OpTiOnS', '_scheme' => 'https', 'locale' => '\w+',),
  18. array('compiler_class' => 'RouteCompiler'),
  19. '{locale}.example.com'
  20. ));
  21. return $collection;