8
0
daux.io/libs/SimplePage.php

40 Zeilen
774 B
PHP

<?php namespace Todaymade\Daux;
class SimplePage implements Page
{
protected $title;
protected $content;
protected $html = null;
2015-04-23 00:32:30 +02:00
public function __construct($title, $content)
{
$this->initializePage($title, $content);
}
2015-04-23 00:32:30 +02:00
public function display()
{
header('Content-type: text/html; charset=utf-8');
2015-04-23 00:32:30 +02:00
echo $this->getContent();
}
2015-04-23 00:32:30 +02:00
public function getContent()
{
if (is_null($this->html)) {
2015-04-23 00:32:30 +02:00
$this->html = $this->generatePage();
}
return $this->html;
}
2015-04-23 00:32:30 +02:00
private function initializePage($title, $content)
{
$this->title = $title;
$this->content = $content;
}
private function generatePage()
{
return $this->content;
}
}