|
|
|
@ -63,17 +63,24 @@ class IndexControl
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
//check layout to see what page should be rendered
|
|
|
|
|
$template = $settings["global"]["theme"] . "/page.twig";
|
|
|
|
|
//check if page is a menu item, if not render along path as usual
|
|
|
|
|
$page = [];
|
|
|
|
|
$book = new Book();
|
|
|
|
|
$page = $book->findPageBySlug($args["third"]);
|
|
|
|
|
if (is_numeric($args["first"])) {
|
|
|
|
|
$page = $book->findPageBySlug($args["third"]);
|
|
|
|
|
} else {
|
|
|
|
|
$page = $book->findPageBySlug($args["first"]);
|
|
|
|
|
}
|
|
|
|
|
$template =
|
|
|
|
|
$settings["global"]["theme"] . "/" . $page["layout"] . ".twig";
|
|
|
|
|
$pageOptions = Sorting::page($page);
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//index
|
|
|
|
|
$template = $settings["global"]["theme"] . "/index.twig";
|
|
|
|
|
$template =
|
|
|
|
|
$settings["global"]["theme"] . "/" . $page["layout"] . ".twig";
|
|
|
|
|
$book = new Book("");
|
|
|
|
|
$page = $book->findPageBySlug();
|
|
|
|
|
$pageOptions = Sorting::page($page);
|
|
|
|
@ -83,6 +90,7 @@ class IndexControl
|
|
|
|
|
$response->getBody()->write($html);
|
|
|
|
|
return $response;
|
|
|
|
|
} else {
|
|
|
|
|
//if dynamic flag is false, load up html
|
|
|
|
|
$view = Twig::fromRequest($request);
|
|
|
|
|
$html = file_get_contents("../public/index.html");
|
|
|
|
|
$response->getBody()->write($html);
|
|
|
|
|