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

Is it available to use custom Requests/Responses? #146

Open
sunlazor opened this issue Aug 31, 2024 · 1 comment
Open

Is it available to use custom Requests/Responses? #146

sunlazor opened this issue Aug 31, 2024 · 1 comment

Comments

@sunlazor
Copy link

Hello 👋 I'm trying to use Htmx with Symfony+Roadrunner but run into a problem. Htmx bundles change Request/Response objects and because of it they don't work with roadrunner-bundle.
I tried https://github.com/tomcri/htmxfony with kernel and controller traits. Problem: requests are loosing POST parameters.
I tried https://github.com/seaworn/symfony-htmx with request factory and controller trait. Problem: roadrunner-bundle do not call Request::create and therefore factory isn't triggered.
Is there any way to make them work together?

@praswicaksono
Copy link

You can make your own implementation by implementing HttpFoundationWorkerInterface then swap current implementation in container using $service->register(HttpFoundationWorkerInterface::class, your-impl)

final class CustomHttpFoundationWorker implements HttpFoundationWorkerInterface 
{

}

you can copy paste current implementation in https://github.com/Baldinof/roadrunner-bundle/blob/3.x/src/RoadRunnerBridge/HttpFoundationWorker.php then just change toSymfonyRequest

Hope it help!

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