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

Suport optinal middle segment #250

Closed
GoldraK opened this issue Mar 12, 2022 · 2 comments
Closed

Suport optinal middle segment #250

GoldraK opened this issue Mar 12, 2022 · 2 comments

Comments

@GoldraK
Copy link

GoldraK commented Mar 12, 2022

Hello,
They could accept this PR (#179), it would be very useful for example to create file managers, not forcing to always have a path from the base path.

In the current situation the url would have to be like this

/file/{path:[A-Za-z0-9\/]+}/{file:[\w,\s-]+\.[A-Za-z]{3,4}}

with this expression I can make these routes

files/mandatory-folder/file.jpg
files/obligatory-folder/another-folder/file.jpg

but i can't do

files/file.jpg

since path is always required.

Thanks for the work.

@icetee
Copy link

icetee commented Aug 28, 2023

This is exactly what I need. My hotfix: I use query param:

$request->getQueryParams();

@lcobucci
Copy link
Collaborator

lcobucci commented Jan 9, 2024

The implementation in #179 has some performance impact that needs to be considered (extra calls, recursion, etc).
I'll look into ways to reduce it as much as possible...

I'm hesitant to prioritise/consider this due to its limited benefit.
It's possible to register two routes (/file/{path:[A-Za-z0-9\/]+}/{file:[\w,\s-]+\.[A-Za-z]{3,4}} and /file/{file:[\w,\s-]+\.[A-Za-z]{3,4}}) that point to the same handler.

Let's keep the discussion on the PR, though 👍

@lcobucci lcobucci closed this as completed Jan 9, 2024
@lcobucci lcobucci closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2024
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

3 participants