Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[routing] Remove final from the MapQueryParameter attribute #57220

Open
@codisart

Description

@codisart

Description

We are using a lot of MapQueryParameter in our project and a lot of them are following some common patterns. For example, we use pagination and we use a query param to define what page was selected in the url. So in order to correctly define it we use
#[MapQueryParameter(options: ['min_range' => 1])] in many places.

We think it would be quite an improvement to be able to extends MapQueryParameter to allow to define specific options only once but also to name the attribute.

Example

#[\Attribute(\Attribute::TARGET_PARAMETER)]
class MapQueryPagination extends MapQueryParameter
{
    public function __construct() {
        parent::__construct(options: ['min_range' => 1]);
    }
}
#[MapQueryPagination] int $page = 1,

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