In my controller I want to return
Drupal\Core\Render\HtmlResponse, and also I want to take HTML content from the template. The problem is that if I will try to
render() a rendereable array before returning HtmlResponse - I'm getting
"The website encountered an unexpected error. Please try again later." error. Array is being rendered correctly when I will just return it as it is, but with all Drupal HTML, which I don't want. What am I doing wrong?
Added #1: Discovery - all works well when I return
Zend\Diactoros\Response\HtmlResponse . Now I'm even more confused. Why is that?
Added #2: When I use "renderPlain()" renderers method it also works, but I'm not sure of drawbacks yet.