$this->addFlash('notice', $this->translator->trans('Your message has been sent'));
//Redirect on the same route with sent=1 to cleanup form
- return $this->redirectToRoute($request->get('_route'), $request->get('_route_params'));
+ return $this->redirectToRoute($request->attributes->get('_route'), $request->attributes->get('_route_params'));
//Catch obvious transport exception
} catch(TransportExceptionInterface $e) {
//Add error message mail unreachable
//Without keywords
} else {
//Set empty modified
- $this->modified = new \DateTime('-1 year');
+ $this->modified = new \DateTimeImmutable('-1 year');
}
//Create response
//With logged user
if ($this->checker->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
//Set last modified
- $response->setLastModified(new \DateTime('-1 year'));
+ $response->setLastModified(new \DateTimeImmutable('-1 year'));
//Set as private
$response->setPrivate();