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

Flight::group lacks nesting support for organizing routes hierarchically. Adding this feature will enhance route management flexibility. #589

Closed
planework opened this issue May 15, 2024 · 3 comments

Comments

@planework
Copy link

planework commented May 15, 2024

Flight::group('/api/v1', function () {
echo "v2";
Flight::group('', function () {
Flight::route('GET /data', function () {
Flight::template()->render('call.index');
});
});
});
Flight::group('/api/v2', function () {
echo "v2";
Flight::group('
', function () {
Flight::route('GET /data', function () {
Flight::template()->render('call.index');
});
});
});

html:
v2v2

@n0nag0n
Copy link
Collaborator

n0nag0n commented May 15, 2024

I guess I'm confused. It already supports nested groups, and it's tested to run that way. The reason why your v2v2 is showing up is because any output buffer into a group function is not captured (nor do I think it should be captured unless there's a good argument for it) because just listing out a group shouldn't immediately invoke some output.

Is that what you're asking for? Output buffering in a group context?

@n0nag0n
Copy link
Collaborator

n0nag0n commented May 15, 2024

Also, love the github username. Flight appreciates your support ;)

@n0nag0n
Copy link
Collaborator

n0nag0n commented May 23, 2024

Feel free to reopen this. Just closing it for now.

@n0nag0n n0nag0n closed this as completed May 23, 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

2 participants