+ /**
+ * Renders a view
+ *
+ * {@inheritdoc}
+ */
+ protected function render(string $view, array $parameters = [], Response $response = null): Response {
+ //Create response when null
+ $response ??= new Response();
+
+ //With empty head locale
+ if (empty($parameters['locale'])) {
+ //Set head locale
+ $parameters['locale'] = $this->locale;
+ }
+
+ /*TODO: XXX: to drop, we have title => [ 'page' => XXX, section => XXX, site => XXX ]
+ //With empty head title and section
+ if (empty($parameters['head']['title']) && !empty($parameters['section'])) {
+ //Set head title
+ $parameters['title'] = implode(' - ', [$parameters['title'], $parameters['section'], $parameters['head']['site']]);
+ //With empty head title
+ } elseif (empty($parameters['head']['title'])) {
+ //Set head title
+ $parameters['head']['title'] = implode(' - ', [$parameters['title'], $parameters['head']['site']]);
+ }*/
+
+ //Call twig render method
+ $content = $this->twig->render($view, $parameters);
+
+ //Invalidate OK response on invalid form
+ if (200 === $response->getStatusCode()) {
+ foreach ($parameters as $v) {
+ if ($v instanceof FormInterface && $v->isSubmitted() && !$v->isValid()) {
+ $response->setStatusCode(422);
+ break;
+ }
+ }
+ }
+
+ //Store content in response
+ $response->setContent($content);
+
+ //Return response
+ return $response;
+ }
+