diff --git a/application/config/factories/templateFactory.php b/application/config/factories/templateFactory.php index 9e0c67a..4b1cf58 100644 --- a/application/config/factories/templateFactory.php +++ b/application/config/factories/templateFactory.php @@ -1,4 +1,4 @@ setSubtemplatePath('/application/src/Infrastructure/templates/')->setSubtemplatePathAlias([ - "main" => "/src/Main/Infrastructure/templates", + "main" => "/src/Infrastructure/templates", ]); diff --git a/application/config/routes/90-main.yaml b/application/config/routes/90-main.yaml index 5ed7763..9f9eaf4 100644 --- a/application/config/routes/90-main.yaml +++ b/application/config/routes/90-main.yaml @@ -1,13 +1,13 @@ # Index - key: "/" routes: - - action: "App\\Main\\Infrastructure\\Controllers\\IndexController" + - action: "App\\Infrastructure\\Controllers\\IndexController" method: "index" params: "" # Empty - key: "<@any>" routes: - - action: "App\\Main\\Infrastructure\\Controllers\\IndexController" + - action: "App\\nfrastructure\\Controllers\\IndexController" method: "emptyAction" params: "" diff --git a/application/config/routes/routes.php b/application/config/routes/routes.php index 1151ccc..a02ee31 100644 --- a/application/config/routes/routes.php +++ b/application/config/routes/routes.php @@ -1,17 +1,15 @@ addHeader("App-Mode", "Dev"); $this->template()->setValue("title", "Главная"); - $this->template()->setSubtemplate("main", "@main/index.tpl", [ - "date" => (new \DateTime())->format('Y-m-d H:i:s') - ]); } catch(\Throwable $e){$error = $this->checkError($e);} - return $this->render(); + + return $this->renderResponse("main", "@main/index.tpl", [ + "date" => (new \DateTime())->format('Y-m-d H:i:s'), + "error" => $error ?? null + ]); } } diff --git a/src/Main/Domain/ValueObject/.gitkeep b/src/Infrastructure/Repository/.gitkeep similarity index 100% rename from src/Main/Domain/ValueObject/.gitkeep rename to src/Infrastructure/Repository/.gitkeep diff --git a/src/Main/Infrastructure/templates/index.tpl b/src/Infrastructure/templates/index.tpl similarity index 100% rename from src/Main/Infrastructure/templates/index.tpl rename to src/Infrastructure/templates/index.tpl diff --git a/src/Main/Infrastructure/Repository/.gitkeep b/src/Main/Infrastructure/Repository/.gitkeep deleted file mode 100644 index e69de29..0000000