Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
odan committed Jul 13, 2024
1 parent d01d93b commit 418060d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,18 @@ $response = $renderer->render(new Response(), 'hello.php', $viewData);
use Slim\AppFactory;
use Slim\Views\PhpRenderer;

include 'vendor/autoload.php';
require __DIR__ . '/../vendor/autoload.php';

$app = AppFactory::create();

$app->get('/hello/{name}', function ($request, $response) {
$app->get('/hello', function ($request, $response) {
$renderer = new PhpRenderer('path/to/templates');

return $renderer->render($response, 'hello.php');
$viewData = [
'name' => 'John',
];

return $renderer->render($response, 'hello.php', $viewData);
});

$app->run();
Expand Down

0 comments on commit 418060d

Please sign in to comment.