pics/templates/Template.php

35 lines
779 B
PHP
Raw Normal View History

<?php
/*****************************************************************************
* Template.php
* Contains key Template interface.
*
* Kabuki CMS (C) 2013-2015, Aaron van Geffen
*****************************************************************************/
abstract class Template
{
protected $_subtemplates = [];
abstract public function html_main();
public function adopt(Template $template, $position = 'end')
{
// By default, we append it.
2022-12-25 13:44:54 +01:00
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;
}
}