SubTemplate: use SubTemplates for boxed content only

This commit is contained in:
2023-03-11 13:37:59 +01:00
parent 0366df9b5f
commit 307d34430a
9 changed files with 53 additions and 23 deletions

View File

@@ -8,10 +8,32 @@
abstract class SubTemplate extends Template
{
protected $_class = 'content-box container';
protected $_id;
protected $_title;
public function __construct($title = '')
{
$this->_title = $title;
}
public function html_main()
{
echo $this->html_content();
echo '
<div class="', $this->_class, '"', isset($this->_id) ? ' id="' . $this->_id . '"' : '', '>',
$this->html_content(), '
</div>';
}
abstract protected function html_content();
public function setClassName($className)
{
$this->_class = $className;
}
public function setDOMId($id)
{
$this->_id = $id;
}
}