Skip to content

[LiveComponent] Multiple URL query params in one LiveProp DTO #2142

Open
@Nayte91

Description

@Nayte91

Hello,

Part of the discussion about faceted search menu and results page combo (challenge 1), I'm searching to map different url parameters into one object.

In a symfony controller, you can welcome several query params in a single DTO with the MapQueryString attribute.

I wonder if we can, also in live components, group several query params into one property class?

In a live component, currently, when you have multiple query parameters to welcome, you must declare them one by one; then eventually, in a method, regroup them into an array or a DTO to do some logic. It can be cumbersome if you have a lot of potential query parameters. Plus, and I feel like it's more important, aligning behavior of component controllers (like a LC), with regular controllers is very important as it drastically lowers the mind burden and learning curve.

Context: you got a FacetedSearchMenu component, with multiple parameters that you want to reflect on url, and you group those in a FacetFilter DTO to pass to repository or whatever.

If I may help in any way,
Best regards,

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions