support for stylesheets
This commit is contained in:
parent
575e2b5a85
commit
6590cee305
17
lib/Page.php
17
lib/Page.php
|
@ -6,6 +6,7 @@ class Page
|
|||
private $pagecontent = '';
|
||||
private $title = '';
|
||||
private $navigation = '';
|
||||
private $style = '';
|
||||
|
||||
//default boilerplate html code
|
||||
private $template = '
|
||||
|
@ -13,6 +14,7 @@ class Page
|
|||
<html lang="de">
|
||||
<head>
|
||||
<title>$$TITLE$$</title>
|
||||
$$STYLE$$
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
|
@ -40,17 +42,26 @@ class Page
|
|||
$this->pagecontent .= $content;
|
||||
}
|
||||
|
||||
public function setTemplate($template){
|
||||
public function setTemplate($template)
|
||||
{
|
||||
$this->template = $template;
|
||||
}
|
||||
|
||||
public function setNavigation($navigation){
|
||||
public function setNavigation($navigation)
|
||||
{
|
||||
$this->navigation = $navigation;
|
||||
}
|
||||
|
||||
public function displayPage(){
|
||||
public function addStylesheet($stylesheet)
|
||||
{
|
||||
$this->style .= '<link rel="stylesheet" href="' . $stylesheet . '">';
|
||||
}
|
||||
|
||||
public function displayPage()
|
||||
{
|
||||
$page = $this->template;
|
||||
$page = str_replace('$$TITLE$$', $this->title, $page);
|
||||
$page = str_replace('$$STYLE$$', $this->style, $page);
|
||||
$page = str_replace('$$NAVIGATION$$', $this->navigation, $page);
|
||||
$page = str_replace('$$PAGECONTENT$$', $this->pagecontent, $page);
|
||||
|
||||
|
|
Loading…
Reference in New Issue