php use Slim Views PhpRenderer use Psr Http Message ResponseInterface

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
use Slim\Views\PhpRenderer;
use Psr\Http\Message\ResponseInterface;
session_start();
ob_start();
require H . 'system/vendor/autoload.php';
try {
require H .'system/common.php';
$response = new ResponseInterface();
$phpView = new PhpRenderer(H . 'app/templates/', ["title" => "My App"]);
$phpView->setLayout("layout.php");
$phpView->render($response, 'main.php', ["title" => "Hello - My App", "name" => "John"]);
} catch (Exception $e) {
die ('Error ' . $e->getMessage());
}
// Fatal error: Uncaught Error: Cannot instantiate interface Psr\Http\Message\ResponseInterface