Skip to content

Commit ab4ac88

Browse files
committed
remove traillingslash and backticks
1 parent a60587c commit ab4ac88

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

doctrine.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ Mapped Route Parameters
867867
When many route parameters are used to find more than one entity,
868868
it 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

885885
When 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

899899
But 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

907907
In 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

924924
When 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

942942
Updating an Object
943943
------------------

0 commit comments

Comments
 (0)