Skip to content

Multiple optional segments #929

Closed
Closed
@LKay

Description

@LKay

I couldn't find that in the docs. Is it possible to define a single route which has multiple optional segments? Let's say I have a list with optional sorting and pagination so I'd like to define route like: /list?(/s/:sort?(/:order)?)?(/page/:page)?. The other thing is matching segments by RegExp, so in the above example the parameter :order could only have values asc or desc. From what I found in Issue #142 there was no matching feature implemented, is that right? For now I ended up with defining 4 different routes pointing to the same handler depending on uri, which is not the optimal solution...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions