how do you use html file views in Silex.
I am trying to use silex with some custom php code where the controller method includes the views files.
Here is what I have: in my index.php
$app->get('/', function (Request $request) {
$homeController = new HomeController($request);
$output = $homeController->show($request);
return new Response($output);
});
$app->run();
And here is the show method of my controller:
ob_start();
include "view/start.html.php";
include "view/header.html.php";
include "view/contact.html.php";
include "view/footer.html.php";
include "view/end.html.php";
return ob_end_clean();
Is there a way to make this work?
I do not want to move the logic of which views to show from the controller to index.php. And also I do not want to use twig for now.
And here is the error that I get:
UnexpectedValueException in Response.php line 403: The Response content must be a string or object implementing __toString(), "boolean" given.
thanks