daux.io/libs/Format/Base/SimplePage.php

34 lignes
684 B
PHP

<?php namespace Todaymade\Daux\Format\Base;
abstract class SimplePage implements Page
{
protected $title;
protected $content;
protected $generated = null;
public function __construct($title, $content)
{
$this->initializePage($title, $content);
}
public function getContent()
{
if (is_null($this->generated)) {
$this->generated = $this->generatePage();
}
return $this->generated;
}
protected function initializePage($title, $content)
{
$this->title = $title;
$this->content = $content;
}
protected function generatePage()
{
return $this->content;
}
}