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

Route with parameters based on PCRE when using the getRoute() function #7

Closed
henry5059 opened this issue Jun 26, 2023 · 5 comments
Closed

Comments

@henry5059
Copy link

Hello, I hope you are very well, to tell you that when writing the route with parameters based on PCRE when using the getRoute() function, it only returns what the image presents. Which I want you to do me the favor of explaining if it is a practice on my part or simply requires a new implementation of routes.
Router PCRE

@mychidarko
Copy link
Member

mychidarko commented Jun 28, 2023

Hi @henry5059 I'll need to look into this, but this is not the expected behaviour

@henry5059
Copy link
Author

Ok, thank you.

@mychidarko
Copy link
Member

Hi @henry5059, I just released a new version that fixes this issue (v0.2.3). You can run leaf install router or composer require leafs/router to fix the issue in your codebase.

You should now see this when you run getRoute()

{
  "pattern": "/users/(.*?)",
  "path": "/users/1",
  "method": "GET",
  "name": "mycontroller",
  "handler": "MyNamespace\\Controller@index",
  "params": [
    "1"
  ]
}

@henry5059
Copy link
Author

excelent, thanks you.

@mychidarko
Copy link
Member

You can close this issue if the fix works for you

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

No branches or pull requests

2 participants