validresource.php 463 B

123456789101112131415161718
  1. <?php
  2. /** @var $loader \Symfony\Component\Routing\Loader\PhpFileLoader */
  3. /** @var \Symfony\Component\Routing\RouteCollection $collection */
  4. $collection = $loader->import('validpattern.php');
  5. $collection->addDefaults([
  6. 'foo' => 123,
  7. ]);
  8. $collection->addRequirements([
  9. 'foo' => '\d+',
  10. ]);
  11. $collection->addOptions([
  12. 'foo' => 'bar',
  13. ]);
  14. $collection->setCondition('context.getMethod() == "POST"');
  15. $collection->addPrefix('/prefix');
  16. return $collection;