You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.0 KiB
PHP
42 lines
1.0 KiB
PHP
<?php
|
|
use Psr\Http\Message\ResponseInterface;
|
|
use Psr\Http\Message\ServerRequestInterface;
|
|
use Slim\Views\Twig;
|
|
|
|
include "../brain/data/Book.inc.php";
|
|
|
|
class DashControl
|
|
{
|
|
public static function start(
|
|
ServerRequestInterface $request,
|
|
ResponseInterface $response,
|
|
array $args
|
|
): ResponseInterface {
|
|
$view = Twig::fromRequest($request);
|
|
$pageOptions = [];
|
|
switch (isset($args["second"]) ? $args["second"] : "index") {
|
|
case "pages":
|
|
$content = [];
|
|
break;
|
|
default:
|
|
//$_SESSION["TEST"] = "TESTERZ";
|
|
//session_unset();
|
|
if (Session::active()) {
|
|
$pageOptions = [
|
|
"title" => "Welcome to Fipamo",
|
|
"status" => Session::active(),
|
|
"data" => (new Book("../content/pages"))->getPages(1, 4),
|
|
];
|
|
} else {
|
|
$pageOptions = [
|
|
"title" => "Welcome to Fipamo",
|
|
"status" => Session::active(),
|
|
];
|
|
}
|
|
|
|
break;
|
|
}
|
|
return $view->render($response, "dash/start.twig", $pageOptions);
|
|
}
|
|
}
|