Add preserveQuery option to PaginatorHelper::limitControl#19178
Add preserveQuery option to PaginatorHelper::limitControl#19178dereuromark wants to merge 3 commits intocakephp:5.xfrom
Conversation
Why though? |
|
limitControl() is the only paginator helper that builds a GET and preserves current query params by turning them into hidden inputs(generateHiddenFields()). That makes “which query params should be carried forward” a form-specific concern. All the other paginator helpers (numbers(), prev(), next(), sort(), meta(), etc.) only generate links via generateUrl()/generateUrlParams(). So the new preserveQuery option is scoped to limitControl() because it’s the only place that needs fine-grained control over hidden fields. If we want this to (based on the open ticket). Feel free to close this if we dont need/want to support it. |
|
With #19182 we probably dont need this anymore. |
Summary
Behavior
preserveQuery: true(default) keeps all query parameters as hidden fieldspreserveQuery: falsekeeps nonepreserveQuery: ["key", ...]only keeps the listed top-level keysDocs