forked from Public/pics
SubTemplate: use SubTemplates for boxed content only
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user