Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Support generating default route w/o parameters #23

Merged
merged 1 commit into from
Oct 3, 2016
Merged

Support generating default route w/o parameters #23

merged 1 commit into from
Oct 3, 2016

Conversation

michaelmoussa
Copy link
Contributor

@michaelmoussa michaelmoussa commented Sep 14, 2016

Given a matched route with name album.index and path /album[/page/{page:\d+}], invoking the UrlHelper with the route name album.index and no additional parameters while on page 5 would return /album/page/5, since it automatically merges existing params from the RouteResult. This behavior would make it impossible to use the UrlHelper to generate the base /album URL while on any page.

Invoking the helper with the new third argument $reuseResultParams set to false will now cause the helper to only take the params provided in the 2nd $params argument into consideration, which will produce the base /album URL in the above example.

BC Breaks:

  • None if UrlHelper is being consumed directly.
  • Method signature change if UrlHelper has been extended.

This addresses #10 , but due to the BC break I've set the milestone to 3.0.0. If this is 👍'ed, I'll likely gather any other potential BC breaking contributions and release them all at once as 3.0.0 with the intention of bringing the helpers repo down to 0 open issues and 0 PRs.

Given a matched route with name `album.index` and path
`/album[/page/{page:\d+}]`, invoking the `UrlHelper` with
the route name `album.index` and no additional parameters
while on page 5 would return `/album/page/5`, since it
automatically merges existing params from the `RouteResult`.
This behavior would make it impossible to use the `UrlHelper`
to generate the base `/album` URL while on any page.

Invoking the helper with the new third argument `$reuseResultParams`
set to `false` will now cause the helper to only take the params
provided in the 2nd `$params` argument into consideration, which will
produce the base `/album` URL in the above example.

BC Breaks:
  - None if `UrlHelper` is being consumed directly.
  - Method signature change if `UrlHelper` has been extended.
@weierophinney
Copy link
Member

👍 from me!

@michaelmoussa
Copy link
Contributor Author

@weierophinney should I merge this into develop, or should I create a dev-3.0.0 base branch and merge it there instead?

@michaelmoussa michaelmoussa changed the base branch from develop to dev-3.0.0 October 3, 2016 03:11
@michaelmoussa
Copy link
Contributor Author

Created dev-3.0.0 off of develop and changed base branch for this PR to that instead, as it's BC breaking and meant to wait.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants