8000 Route with default value for query string param causes param to get eaten · Issue #10940 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Route with default value for query string param causes param to get eaten #10940
Closed
@nickshanks

Description

@nickshanks

Given a route like this:

book:
    path: /book
    defaults:
        page: 1

I would expect generate('book', {'page': $page}) to generate these routes:

  1. /book when $page == 1
  2. /book?page=2 when $page == 2

What actually happens is that when a parameter has a default value, but is not present in the route path, it just gets eaten by Symfony. Both of the above values for $page result in the path /page being generated.

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

      0