maybe this'll work

This commit is contained in:
Pachira 2015-03-08 06:49:21 +01:00
parent a7b0e045ee
commit bf23e17a00

View file

@ -48,18 +48,25 @@ class Flashii {
}
// Initialise Twig
public function initTwig($templateName = null, $templatesFolder = null) {
private function initTwig($templateName = null) {
// Assign default values set in the configuration if $templateName and $templatesFolder are null
$templateName = is_null($templateName) ? self::getConfig('etc', 'design') : $templateName;
$templatesFolder = is_null($templatesFolder) ? self::getConfig('etc', 'templatesPath') : $templatesFolder;
$templateName = is_null($templateName) ? Configuration::getConfig('template') : $templateName;
// Set variable for public access
self::$_TPLPUBPATH = 'http'. (isset($_SERVER['HTTPS']) ? 's' : '') .'://'. $_SERVER['SERVER_NAME'] . '/templates/'. $templateName;
// Initialise Twig Filesystem Loader
$twigLoader = new \Twig_Loader_Filesystem($templatesFolder . $templateName);
$twigLoader = new \Twig_Loader_Filesystem(ROOT_DIRECTORY .'templates/'. $templateName .'/templates');
// And now actually initialise the templating engine
$this->twig = new \Twig_Environment($twigLoader, array(
// 'cache' => $satoko['cacheFolder']
$this->_TPL = new \Twig_Environment($twigLoader, array(
// 'cache' => ROOT_DIRECTORY. $satoko['cacheFolder']
));
// Load String template loader
$this->_TPL->addExtension(new \Twig_Extension_StringLoader());
}
// Initialise Parsedown