diff --git a/src/Dispatcher/Dispatcher.php b/src/Dispatcher/Dispatcher.php index 86b3b746..80d87721 100644 --- a/src/Dispatcher/Dispatcher.php +++ b/src/Dispatcher/Dispatcher.php @@ -136,6 +136,7 @@ public function process() { // Instantiate the response content object, for manipulation in Code. $content = $this->createResponseContent($source, $this->response->config); + $this->setContentUri($this->request->uri, $content); $this->cleanBuffer(); // Only execute Logic if the response is a success. @@ -163,7 +164,6 @@ public function process() { } } - $manifest = $content->createManifest($this->request, $this->response); $fileOrganiser = new FileOrganiser($this->response, $manifest); $fileOrganiser->organise($manifest->pathDetails); diff --git a/src/Dispatcher/PageDispatcher.php b/src/Dispatcher/PageDispatcher.php index d2caa34e..2be8be53 100644 --- a/src/Dispatcher/PageDispatcher.php +++ b/src/Dispatcher/PageDispatcher.php @@ -11,6 +11,7 @@ use \Gt\Core\Path; use \Gt\Response\NotFoundException; use \Gt\Page\Transformer; +use \Gt\Response\ResponseContent; class PageDispatcher extends Dispatcher { @@ -197,4 +198,17 @@ public function createResponseContent($html, $config) { return $domDocument; } +/** + * + */ +public function setContentUri($uri, ResponseContent $content) { + if(strrpos($uri, "/") === strlen($uri) - 1) { + $uri .= "index"; + } + $uri = trim($uri, "/"); + $uri = str_replace("/", "_", $uri); + $idUri = $uri; + $content->querySelector("body")->id = $idUri; +} + }# \ No newline at end of file