|
|
@@ -36,7 +36,8 @@ function addFooter($response) |
|
|
|
} |
|
|
|
|
|
|
|
function init() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
$art1 = ["slug" => "artikel-1", "title" => "Dit is titel 1", "content" => "Lorem ipsum 1"]; |
|
|
|
$art2 = ["slug" => "artikel-2", "title" => "Dit is titel 2", "content" => "Lorem ipsum 2"]; |
|
|
|
$art3 = ["slug" => "artikel-3", "title" => "Dit is titel 3", "content" => "Lorem ipsum 3"]; |
|
|
@@ -46,6 +47,11 @@ function init() |
|
|
|
|
|
|
|
|
|
|
|
$app->get('/', function (Request $request, Response $response, array $args) { |
|
|
|
global $db; |
|
|
|
$sql = "SELECT * FROM blogs"; |
|
|
|
$ret = $db->query($sql); |
|
|
|
$blogArray = $ret->fetchArray(SQLITE3_ASSOC); |
|
|
|
|
|
|
|
if (!isset($_SESSION['blogs'])) { |
|
|
|
init(); |
|
|
|
} |