I'm working with Slim 3 and for rendering I'm using PHP-View. I'm iniating the renderer like this:
...
$container['view'] = new \Slim\Views\PhpRenderer("../mytemplatesfolder/");
$app = new \Slim\App();
$container = $app->getContainer();
$container['renderer'] = new PhpRenderer("templates");
I can render the templates without any problem in my routes, like this:
$app->get('/someroute', function (Request $request, Response $response){
return $this->renderer->render($response, "/onetemplate.phtml");
});
How can I render a custom template (using PHP-View, not Twig) when the 404 error happens?
I found this answer using Twig, but I can't figure it out how to to do it using PHP-View.