Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Url resolve fails with 2 numeric parameter #315

Open
ghost opened this issue Sep 2, 2021 · 3 comments
Open

Url resolve fails with 2 numeric parameter #315

ghost opened this issue Sep 2, 2021 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Sep 2, 2021

/test/{id:\d+}/test/{domainId:\d+}/delete

see PR #314 for a failing test

@kkFelix
Copy link

kkFelix commented May 17, 2022

Any news on this?
It also fails when any first parameter contains any regex.

$route = new Route('GET', '/date/{year:\d+}/{month}', static function () { });
$path = $route->getPath([
    'year' => 2000,
    'month' => 1
]); // returns just "date/2000"

This is especially unfortunate if you want to use localized urls like this:

$route = new Route('GET', '/lang/{lang:(?:de|en))}/test/{foo}', static function () { });
$path = $route->getPath([
    'lang' => 'en',
    'foo' => 42
]); // returns just "lang/en"

@philipobenito
Copy link
Member

Sorry for the delay, been dealing with some health issues.

Planning a merge/release session next week so will sort then.

@switchplane-tom
Copy link

Do you have any update on this issue at all? It seems to be caused when there is more than one wildcard with a matcher.

$route = new \League\Route\Route('GET', '/a/{wildcard}/and/{wildcardWithMatcher:uuid}/and/{anotherWildcardWithMatcher:uuid}', static function () {
});
$path = $route->getPath([
    'wildcard'            => 'replaced-wildcard',
    'wildcardWithMatcher' => 'replaced-wildcard-with-matcher',
    'anotherWildcardWithMatcher' => 'replaced-another-wildcard-with-matcher'
]); // returns just "/a/replaced-wildcard/and/replaced-wildcard-with-matcher"

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

No branches or pull requests

3 participants