I downloaded the Php-View library to use with the Slim Framework 3. x, but I'm not able to do the view return.
// Get container
$container = $app->getContainer();
// Register component on container
$container['view'] = function ($container) {
return new \Slim\Views\PhpRenderer('App/resources/views');
};
$app->get('/', function($request, $response) {
$tes = new \App\Teste(); // Usando Eloquent ORM
$tes->nome = "OI";
return $this->view->render($response, "home.php", array("obj" => $tes->nome));
});
$app->run();
If I make a var_dump($tes)
, I get the object normally, but if I try to call the view I only get the error
A website error has occurred. Sorry for the temporary inconvenience.