You have injected the Request via parameter $request. This is generally not recommended as there might be multiple instances during a request cycle (f.e. when using sub-requests). Instead, it is recommended to inject the RequestStack and retrieve the current request each time you need it via getCurrentRequest().
Loading history...
39
{
40
$this->form = $form;
41
$this->request = $request;
42
}
43
44
public function getForm(): FormInterface
45
{
46
return $this->form;
47
}
48
49
public function getRequest(): Request
50
{
51
return $this->request;
52
}
53
54
public function setResponse(Response $response): void