2016-09-01 23:13:23 +02:00
|
|
|
<?php
|
|
|
|
/*****************************************************************************
|
|
|
|
* Template.php
|
|
|
|
* Contains key Template interface.
|
|
|
|
*
|
|
|
|
* Kabuki CMS (C) 2013-2015, Aaron van Geffen
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
abstract class Template
|
|
|
|
{
|
2019-09-29 14:47:56 +02:00
|
|
|
protected $_subtemplates = [];
|
2016-09-01 23:13:23 +02:00
|
|
|
|
|
|
|
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')
|
2016-09-01 23:13:23 +02:00
|
|
|
$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;
|
|
|
|
}
|
|
|
|
}
|