Skip to content

Adding query parameters to URL route? #5

Closed
@bradical1379

Description

@bradical1379

Is it possible to pass additional query parameters on a route, and if so, how can we capture those parameters in tandem with the route parameters?

For example, if you have the route:

// search books
$router->get('/books/title/:title', 'Books@searchBooksByTitle');

Could append the URL to include some additional parameters like:

https://localhost/books/title/Harry?sort=publish_date

I am running into issues when I attempt that it says the requested route is not found, and I believe that is because its explicitly looking for a route to match with the query parameters on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions