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 $pagecontent = '';
|
||||||
private $title = '';
|
private $title = '';
|
||||||
private $navigation = '';
|
private $navigation = '';
|
||||||
|
private $style = '';
|
||||||
|
|
||||||
//default boilerplate html code
|
//default boilerplate html code
|
||||||
private $template = '
|
private $template = '
|
||||||
@ -13,6 +14,7 @@ class Page
|
|||||||
<html lang="de">
|
<html lang="de">
|
||||||
<head>
|
<head>
|
||||||
<title>$$TITLE$$</title>
|
<title>$$TITLE$$</title>
|
||||||
|
$$STYLE$$
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav>
|
<nav>
|
||||||
@ -40,17 +42,26 @@ class Page
|
|||||||
$this->pagecontent .= $content;
|
$this->pagecontent .= $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTemplate($template){
|
public function setTemplate($template)
|
||||||
|
{
|
||||||
$this->template = $template;
|
$this->template = $template;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNavigation($navigation){
|
public function setNavigation($navigation)
|
||||||
|
{
|
||||||
$this->navigation = $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 = $this->template;
|
||||||
$page = str_replace('$$TITLE$$', $this->title, $page);
|
$page = str_replace('$$TITLE$$', $this->title, $page);
|
||||||
|
$page = str_replace('$$STYLE$$', $this->style, $page);
|
||||||
$page = str_replace('$$NAVIGATION$$', $this->navigation, $page);
|
$page = str_replace('$$NAVIGATION$$', $this->navigation, $page);
|
||||||
$page = str_replace('$$PAGECONTENT$$', $this->pagecontent, $page);
|
$page = str_replace('$$PAGECONTENT$$', $this->pagecontent, $page);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user