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

[5.x] Add support for $view parameter closure with Statamic::route() #11452

Draft
wants to merge 11 commits into
base: 5.x
Choose a base branch
from

Conversation

jesseleite
Copy link
Member

This PR adds support for optional $view parameter closure with Statamic::route(), so that you can dynamically render a view from a route segment.

For example, this works fine in Laravel...

Route::get('/components/{component}', function ($component) {
    return view($component);
});

So this should work with Statamic routes as well...

Route::statamic('/components/{component}', function ($component) {
    return view($component);
});

References #9953

@jesseleite jesseleite marked this pull request as draft February 13, 2025 17:38
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

Successfully merging this pull request may close these issues.

1 participant