Closed glensc closed 3 years ago
Update each route to return a Response, or update $response. This is the pattern to be used and without magic.
Response
This undoes the middleware for render:
I believe the original purpose was to able to test controllers behavior, this problem is solved by fetching all() from view:
all()
- $result = $this->runs->templateVars(); + $result = $this->view->all();
In fact, this brought up a problem that tests did not even use proper View. Tests used default \Slim\View not \Slim\Views\Twig and that View did not have template extensions present.
\Slim\View
\Slim\Views\Twig
Update each route to return a
Response
, or update $response. This is the pattern to be used and without magic.This undoes the middleware for render:
I believe the original purpose was to able to test controllers behavior, this problem is solved by fetching
all()
from view:In fact, this brought up a problem that tests did not even use proper View. Tests used default
\Slim\View
not\Slim\Views\Twig
and that View did not have template extensions present.