daux.io/libs/SimplePage.php
Stéphane Goetz de1214cbab Convert to PSR2
2015-07-20 20:49:09 +02:00

40 lignes
774 B
PHP

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