mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-26 13:01:09 -05:00
git-subtree-dir: TriviaTime git-subtree-mainline: 3551587ecdefc75e34b8b2a87d91a466bdf4c764 git-subtree-split: ae216897cd9c45259853c3f84eae826f344482aa
53 lines
1.3 KiB
PHP
53 lines
1.3 KiB
PHP
<?php
|
|
class Renderer
|
|
{
|
|
protected $title = '';
|
|
protected $currentPage = '';
|
|
protected $config;
|
|
protected $container;
|
|
|
|
public function __construct($config, $container) {
|
|
$this->config = $config;
|
|
$this->container = $container;
|
|
}
|
|
|
|
public function render($page, $values, $useTemplate=true) {
|
|
$viewVars = array();
|
|
$viewVars['title'] = $this->title;
|
|
if($this->title != '') {
|
|
$viewVars['title'] .= ' · ';
|
|
}
|
|
|
|
$viewVars['currentPage'] = $this->currentPage;
|
|
$container = $this->container;
|
|
|
|
if($useTemplate) {
|
|
include($this->config['viewLocation'] . 'header.html.php');
|
|
include($this->config['viewLocation'] . $page);
|
|
include($this->config['viewLocation'] . 'footer.html.php');
|
|
} else {
|
|
include($this->config['viewLocation'] . $page);
|
|
}
|
|
}
|
|
|
|
public function setTitle($title) {
|
|
$this->title = $title;
|
|
}
|
|
|
|
public function setCurrentPage($currentPage) {
|
|
$this->currentPage = $currentPage;
|
|
}
|
|
|
|
public function getContainer() {
|
|
return $this->container;
|
|
}
|
|
|
|
public function getTitle() {
|
|
return $this->title;
|
|
}
|
|
|
|
public function getCurrentPage() {
|
|
return $this->currentPage;
|
|
}
|
|
}
|