I need to get there some more data and for some other pages I need also db inserts etc…
My standard code is:
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
public function index(Request $request, Response $response, $args)
//return "contr. return msg!";
return $this->view->render($response, 'home.twig');
Hello! I don’t understand how to use twig render outside the response psr7 …
If in my controller I use a private function to send an email, I can’t use
because slim return
Argument 1 passed to Slim\Views\Twig::render() must implement interface Psr\Http\Message\ResponseInterface, string given …
I used and followed the bookshelf example, infact everything else is ok.
What is the best practice to send htmlbody email rendered by twig in a separate controller function ?
For a single function as sendEmail() I must pass the $response object from dispatch funcion? It’s correct to think in this way ?
Thank you very very much!