I can’t figure out how to forward a request / perform a sub request to an API endpoint controller. I tried the following (the _controller
value comes from router:match
result, but it’s not a controller that actually exists as service as class.
use SymfonyContractsHttpClientHttpClientInterface;
$subRequest = new Request();
$subRequest->attributes->set('_controller', 'api_platform.action.get_collection');
$httpKernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
The servive id is an alias for api_platform.action.placeholder
,
but using that I get
Could not resolve argument $data of "api_platform.action.placeholder::__invoke()", maybe you forgot to register the controller as a service or missed tagging it with the "controller.service_arguments"?
.