Hello,
I need to have a route that points to a index.html which has it’s own and tag. I tried multiple solutions and every time, what’s return include the Slim response and and inside the the content of my index.html file
$path = getcwd().'/../myApp';
$file = '/index.html';
if (file_exists($path.$file)) {
$newResp = new \Slim\Http\Response();
$newResp->write($path.$file);
return $response;
} else {
throw new \Slim\Exception\NotFoundException($request, $response);
}
Or with PhpRenderer
if (file_exists($path.$file)) {
$phpView = new PhpRenderer($path);
$response = $phpView->render($response, $file, array(0));
return $response;
} else {
throw new \Slim\Exception\NotFoundException($request, $response);
}
Anyone can tell me how to return only my index.html file with Slim ?