validpattern.php 449 B

123456789101112131415161718
  1. <?php
  2. use Symfony\Component\Routing\Route;
  3. use Symfony\Component\Routing\RouteCollection;
  4. $collection = new RouteCollection();
  5. $collection->add('blog_show', new Route(
  6. '/blog/{slug}',
  7. ['_controller' => 'MyBlogBundle:Blog:show'],
  8. ['locale' => '\w+'],
  9. ['compiler_class' => 'RouteCompiler'],
  10. '{locale}.example.com',
  11. ['https'],
  12. ['GET', 'POST', 'put', 'OpTiOnS'],
  13. 'context.getMethod() == "GET"'
  14. ));
  15. return $collection;