No description provided. ?
Suggest add array to items collection
https://github.com/slimphp/Twig-View/pull/66
need to collect items from different classes that not have Response
not important as it will be called offsetAdd or addGlobal or like on another
Hello @geggleto, @codeguy
It would be nice to have a View template renderer interface and a different signature for the render method:
public function render($template, array $data = []);
I believe that a template renderer should not be aware of nor interact with Psr\Http\Message\ResponseInterface.
The response can be written to directly inside middleware using the response interface methods. Something like this:
return $response->write(
$this->view->render('/my/template/file.phtml', [
//..key=>value pairs here
]);
);
//or
return new HtmlResponse($this->view->render('/my/template/file.phtml', [/*...*/]);
kind regards
Issues need to be opened on relevant repositories for Slim 4 updates.
Most helpful comment
Hello @geggleto, @codeguy
It would be nice to have a View template renderer interface and a different signature for the
rendermethod:I believe that a template renderer should not be aware of nor interact with
Psr\Http\Message\ResponseInterface.The response can be written to directly inside middleware using the response interface methods. Something like this:
kind regards