XOOPS  2.6.0
AbstractTemplate.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  */
11 
12 namespace Xmf\Template;
13 
27 abstract class AbstractTemplate
28 {
32  protected $tpl;
33 
37  private $template;
38 
42  public function __construct()
43  {
44  $this->tpl = new \XoopsTpl();
45  $this->template = "module:system/system_dummy.tpl";
46  $this->init();
47  }
48 
54  abstract protected function init();
55 
61  abstract protected function render();
62 
70  protected function setTemplate($template = '')
71  {
72  $this->template = $template;
73  }
74 
80  protected function disableLogger()
81  {
82  \Xoops::getInstance()->logger()->quiet();
83  }
84 
90  public function fetch()
91  {
92  $this->render();
93 
94  return $this->tpl->fetch($this->template);
95  }
96 
102  public function display()
103  {
104  echo $this->fetch();
105  }
106 }
static getInstance()
Definition: Xoops.php:160