DefaultValueController.php 501 B

123456789101112131415161718192021
  1. <?php
  2. namespace Symfony\Component\Routing\Tests\Fixtures\AttributeFixtures;
  3. use Symfony\Component\Routing\Annotation\Route;
  4. class DefaultValueController
  5. {
  6. #[Route(path: '/{default}/path', name: 'action')]
  7. public function action($default = 'value')
  8. {
  9. }
  10. #[
  11. Route(path: '/hello/{name<\w+>}', name: 'hello_without_default'),
  12. Route(path: 'hello/{name<\w+>?Symfony}', name: 'hello_with_default'),
  13. ]
  14. public function hello(string $name = 'World')
  15. {
  16. }
  17. }