Skip to content

FEATURE: Make it easier to create URLs with query strings #5881

Description

@bwaidelich

Currently, the only supported way to create URLs with query strings is a GET form like:

<form action={actionUri} method="GET">
  <input type="text" name="query" />
  // ...
</form>

Using routing arguments in combination with appendExceedingArguments is mostly a bad idea because it creates a routing cache entry for every combination.

For example:

Routes.yaml:

-
  uriPattern: 'some-url'
  defaults:
    '@package': 'Some.Package'
    '@controller': 'Some'
    '@action':  'index'
  appendExceedingArguments: true

TagList.fusion:

// ...
renderer = Neos.Fusion:Loop {
  items = ${tags}
  itemRenderer = Neos.Fusion:ActionUri {
    package = 'Some.Package'
    controller = 'Some'
    action = 'index'
    arguments {
      tag = ${item}
    }
  }
}

This will generate a cache entry for every tag.

Instead, we should allow query parameters to be set explicitly:

renderer = Neos.Fusion:Loop {
  items = ${tags}
  itemRenderer = Neos.Fusion:ActionUri {
    package = 'Some.Package'
    controller = 'Some'
    action = 'index'
    queryParameters {
      tag = ${item}
    }
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions