ArticleController.php 935 B

123456789101112131415161718192021222324252627282930313233343536373839
  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 callable
  29. * - _fragment is the URI fragment (not sent by user agents over HTTP)
  30. * - _locale is used to set the locale on the request
  31. */
  32. public function show($_locale, $year, $slug) {
  33. }
  34. }