@@ -867,7 +867,7 @@ Mapped Route Parameters
867867When many route parameters are used to find more than one entity,
868868it is mandatory to use ``#[MapEntity] `` attributes and this can become cumbersome::
869869
870- #[Route('/document/{slug}/{id}-{name}/ ')]
870+ #[Route('/document/{slug}/{id}-{name}')]
871871 public function showDocument(
872872 #[MapEntity(mapping: ['slug' => 'slug'])]
873873 Category $category,
@@ -884,7 +884,7 @@ As an alternative, you can also use Mapped Route Parameters.
884884
885885When adding route parameters, you can now define the mapping between the route parameter and the controller argument::
886886
887- #[Route('/document/{slug:category}/{id:document}-{name:document}/ ')]
887+ #[Route('/document/{slug:category}/{id:document}-{name:document}')]
888888 public function showDocument(Document $document, Category $category): Response
889889 {
890890 // the database queries in this case would be:
@@ -894,19 +894,19 @@ When adding route parameters, you can now define the mapping between the route p
894894
895895.. versionadded :: 7.1
896896
897- The `` Mapped Route Parameters `` was introduced in Symfony 7.1.
897+ The Mapped Route Parameters was introduced in Symfony 7.1.
898898
899899But when two properties have the same name, you will catach an error if you try ::
900900
901- #[Route('/document/{slug:category}/{id:document}-{slug:document}/ ')]
901+ #[Route('/document/{slug:category}/{id:document}-{slug:document}')]
902902 public function showDocument(Document $document, Category $category): Response
903903 {
904904 // category entity and document entity have the same property ``slug`` but in the route_parameters we can't have two ``slug`` arguments.
905905 }
906906
907907In this case we have to return to MapEntiy::
908908
909- #[Route('/document/{slugCategory}/{id}-{slugDocument}/ ')]
909+ #[Route('/document/{slugCategory}/{id}-{slugDocument}')]
910910 public function showDocument(
911911 #[MapEntity(mapping: ['slugCategory' => 'slug'])]
912912 Category $category
@@ -919,11 +919,11 @@ In this case we have to return to MapEntiy::
919919 // $category = $categoryRepository->findOneBy(['slug' => 'the slug category']);
920920 }
921921
922- As an alternative, you can use `` Aliased Mapped Route Parameters `` .
922+ As an alternative, you can use Aliased Mapped Route Parameters.
923923
924924When adding route parameters, you can now define the mapping between the route parameter and the controller argument with an alias::
925925
926- #[Route('/document/{slugCategory:category.slug}/{id:document}-{slugDocument:document.slug}/ ')]
926+ #[Route('/document/{slugCategory:category.slug}/{id:document}-{slugDocument:document.slug}')]
927927 public function showDocument(Document $document, Category $category): Response
928928 {
929929 // the database queries in this case would be:
@@ -937,7 +937,7 @@ In this case, _route_mapping keys will be slugCategory and slugDocument, and use
937937
938938.. versionadded :: 7.3
939939
940- The `` Aliased Mapped Route Parameters `` was introduced in Symfony 7.3.
940+ The Aliased Mapped Route Parameters was introduced in Symfony 7.3.
941941
942942Updating an Object
943943------------------
0 commit comments