Skip to content

[Routing] add mapped route parameters and aliases #20812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
corrections
  • Loading branch information
eltharin committed Mar 24, 2025
commit 36cdca56449aaa2b8312b1962fb0c42a4321abdb
5 changes: 3 additions & 2 deletions doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,8 @@ control behavior:
Mapped Route Parameters
~~~~~~~~~~~~~~~~~~~~~~~

When many route parameters are used to find more than one entity, it is mandatory to use #[MapEntity] attributes and this can become cumbersome::
When many route parameters are used to find more than one entity,
it is mandatory to use #[MapEntity] attributes and this can become cumbersome::

#[Route('/document/{slug}/{id}-{name}/')]
public function showDocument(
Expand Down Expand Up @@ -918,7 +919,7 @@ In this case we have to return to MapEntiy::
// $category = $categoryRepository->findOneBy(['slug' => 'the slug category']);
}

As an alternative, tou can use ``Aliased Mapped Route Parameters``.
As an alternative, you can use ``Aliased Mapped Route Parameters``.

When adding route parameters, you can now define the mapping between the route parameter and the controller argument with an alias::

Expand Down
Loading