perftools / xhgui

Web interface for XHProf profiling data can store data in MongoDB or PDO database
1.65k stars 342 forks source link

Add render() method to be called from controllers #399

Closed glensc closed 3 years ago

glensc commented 3 years ago

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:

-        $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.