pics/templates/Template.php
Aaron van Geffen ab0e4efbcb Initial commit.
This is to be the new HashRU website based on the Aaronweb.net/Kabuki CMS.
2017-11-09 17:00:22 +01:00

35 lines
783 B
PHP

<?php
/*****************************************************************************
* Template.php
* Contains key Template interface.
*
* Kabuki CMS (C) 2013-2015, Aaron van Geffen
*****************************************************************************/
abstract class Template
{
protected $_subtemplates = array();
abstract public function html_main();
public function adopt(Template $template, $position = 'end')
{
// By default, we append it.
if ($position == 'end')
$this->_subtemplates[] = $template;
// We can also add it to the beginning of the list, though.
else
array_unshift($this->_subtemplates, $template);
}
public function clear()
{
$this->_subtemplates = [];
}
public function pass($id, $data)
{
$this->{$id} = $data;
}
}