0
I did the download library Php-View to use together with Slim Framework 3.x, but I am not able to make the return of view.
// 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 one var_dump($tes)
, I receive the object normally, but if I try to call the view only get the error
A website error has occurred. Sorry for the Temporary inconvenience.