Skip to content

Conversation

@bjorvack
Copy link
Contributor

@bjorvack bjorvack commented Jan 11, 2024

Add support for the #[MapEntity] attribute in routes to map the correct parameter to fetch the entity

example:

url https://app.wip/file/DPLA167

    #[Route('/file/{file}', name: 'file', requirements: ['file' => '^DPLA\d+'])]
    #[Breadcrumb('{file.number}', parent: ['name' => 'file_overview'])]
    public function __invoke(
        #[MapEntity(mapping: ['file' => 'number'])] File $file,
    ): Response {
        ...
    }

@bjorvack bjorvack requested a review from a team January 11, 2024 19:30
@bjorvack bjorvack merged commit b0d66c0 into master Jan 12, 2024
@jonasdekeukelaere jonasdekeukelaere deleted the add-map-entity-support-to-breadcrumb branch October 11, 2024 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants