ArticleController.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Component\Routing\Annotation\Route;
  4. class ArticleController {
  5. /**
  6. * @param $_locale
  7. * @param $year
  8. * @param $slug
  9. *
  10. * @Route(
  11. * path = "/articles/{_locale}/{year}/{slug}.{_format}",
  12. * name = "article_show",
  13. * defaults = {
  14. * "_format": "html",
  15. * },
  16. * requirements = {
  17. * "_locale": "en|fr",
  18. * "_format": "html|rss",
  19. * "year": "\d+"
  20. * }
  21. *
  22. * )
  23. *
  24. * - placeholders cannot be more than 32 characters long
  25. * - Special placeholders:
  26. * - _format is a special parameter used for the request format and content
  27. * type negotiation
  28. * - _controller defines the controller for the route as a PHP callable,
  29. * including class names if they implement __invoke(); or the service
  30. * notation service:method.
  31. * - _fragment is the URI fragment (not sent by user agents over HTTP)
  32. * - _locale is used to set the locale on the request
  33. */
  34. public function show($_locale, $year, $slug) {
  35. }
  36. }