From 575e2b5a859f4e753f0ba01fba2870e24accd75a Mon Sep 17 00:00:00 2001 From: Goeran Heinemann Date: Wed, 12 May 2021 15:59:11 +0200 Subject: [PATCH] firt write up of basic page class --- lib/Page.php | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 lib/Page.php diff --git a/lib/Page.php b/lib/Page.php new file mode 100644 index 0000000..4da455e --- /dev/null +++ b/lib/Page.php @@ -0,0 +1,59 @@ + + + + $$TITLE$$ + + + +
+ $$PAGECONTENT$$ +
+ + + '; + + public function __construct() + { + + } + + public function __destruct($title) + { + $this->title = $title; + } + + public function addContent($content) + { + $this->pagecontent .= $content; + } + + public function setTemplate($template){ + $this->template = $template; + } + + public function setNavigation($navigation){ + $this->navigation = $navigation; + } + + public function displayPage(){ + $page = $this->template; + $page = str_replace('$$TITLE$$', $this->title, $page); + $page = str_replace('$$NAVIGATION$$', $this->navigation, $page); + $page = str_replace('$$PAGECONTENT$$', $this->pagecontent, $page); + + echo $page; + } +} \ No newline at end of file