Selaa lähdekoodia

dynamic load blog contents

blogs_session
Ruben De Baets 2 vuotta sitten
vanhempi
commit
b81f06155b
1 muutettua tiedostoa jossa 5 lisäystä ja 2 poistoa
  1. 5
    2
      public/index.php

+ 5
- 2
public/index.php Näytä tiedosto

@@ -58,8 +58,11 @@ $app->get('/', function (Request $request, Response $response, array $args) {
$app->get('/blog/{slug}', function (Request $request, Response $response, array $args) {

addNavbar($response);
$title = $args['slug'];
$response->getBody()->write("<h1>$title</h1>");
foreach ($_SESSION['blogs'] as $art) {
if ($art['slug'] == $args['slug']) {
$response->getBody()->write("<h1>" . $art['title'] . "</h1>");
}
}

addFooter($response);
return $response;

Loading…
Peruuta
Tallenna