-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Wildcard no longer works when route ends on slash #4
Comments
Excuse me; I think this bug was not recently introduced. But matches existing behaviour. As this will be deprecated; feel free to close. I'll roll my own wildcard implementation for now that simply consumes the remainder of the path. Originally posted by @roelvanduijnhoven at zendframework/zend-router#49 (comment) |
Reference for anybody looking for something like what I described: class MatchEverything implements RouteInterface
{
/** @var array */
private $defaults;
public function __construct(array $defaults)
{
$this->defaults = $defaults;
}
public function getAssembledParams()
{
return [];
}
public static function factory($options = [])
{
return new self($options['defaults'] ?? []);
}
public function match(Request $request, $pathOffset = null)
{
if (!method_exists($request, 'getUri')) {
return null;
}
$remainder = substr($request->getUri()->getPath(), $pathOffset);
return new RouteMatch($this->defaults, strlen($remainder));
}
public function assemble(array $params = [], array $options = [])
{
return '';
}
} Originally posted by @roelvanduijnhoven at zendframework/zend-router#49 (comment) |
I am closing it as wildcard is deprecated |
One can reproduce this using:
Was introduced in zendframework/zend-router#47 by @weierophinney
Originally posted by @roelvanduijnhoven at zendframework/zend-router#49
The text was updated successfully, but these errors were encountered: