@ -8,14 +8,13 @@ class ThemeEngine
public $loader;
public $twig;
public function __construct(string $themePath, string $themeAssetPath )
public function __construct(string $themePath)
{
$var = [];
$this->themePath = $themePath;
$this->themeAssetPath = $themeAssetPath;
$path = explode('/', $themeAssetPath);
$this->themeFolder = $path[4];
$this->settings = json_decode(
$var = [];
$this->themePath = $themePath;
//$path = explode('/', $themeAssetPath);
//$this->themeFolder = $path[4];
$this->settings = json_decode(
file_get_contents('./data/settings.json'),
true
);
@ -25,7 +24,7 @@ class ThemeEngine
true
);
$this->loader = new \Twig\Loader\FilesystemLoader(
$themePath . '/' . $path[4]
$themePath . '/'
);
$this->twig = new \Twig\Environment($this->loader, []);
$this->router($_SERVER['REQUEST_URI']);
@ -36,7 +35,7 @@ class ThemeEngine
$pageInfo = [
'keywords' => $this->settings['keywords'],
'description' => $this->settings['description'],
'image' => $this->themeAsset Path . '/assets/images/global/default-bg.jpg',
'image' => $this->themePath . '/assets/images/global/default-bg.jpg',
];
$featureList = explode(',', $this->posts['feature']);
@ -70,10 +69,10 @@ class ThemeEngine
$pageOptions = [
'debug' => true, // for theme kit
'theme' => $this->themeFolder , // for theme kit
'theme' => $this->themePath , // for theme kit
'title' => 'This is Fipamo',
'dynamicRender' => $this->settings['dynamicRender'],
'background' => $this->themeAsset Path . '/assets/images/global/default-bg.jpg',
'background' => $this->themePath . '/assets/images/global/default-bg.jpg',
'recent' => $recent,
'featured' => $featured,
'info' => $pageInfo,
@ -89,10 +88,10 @@ class ThemeEngine
$template = $request . '.twig';
$pageOptions = [
'debug' => true, // for theme kit
'theme' => $this->themeFolder , // for theme kit
'theme' => $this->themePath , // for theme kit
'title' => 'Page Title',
'dynamicRender' => $this->settings['dynamicRender'],
'background' => $this->themeAsset Path . '/assets/images/global/default-bg.jpg',
'background' => $this->themePath . '/assets/images/global/default-bg.jpg',
'content' => $content,
'meta' => $meta,
'info' => $pageInfo,
@ -106,10 +105,10 @@ class ThemeEngine
$template = 'tags.twig';
$pageOptions = [
'debug' => true, // for theme kit
'theme' => $this->themeFolder , // for theme kit
'theme' => $this->themePath , // for theme kit
'title' => 'Pages Tagged as Tag',
'dynamicRender' => $this->settings['dynamicRender'],
'background' => $this->themeAsset Path . '/assets/images/global/default-bg.jpg',
'background' => $this->themePath . '/assets/images/global/default-bg.jpg',
'tag_list' => $tags,
'info' => $pageInfo,
'menu' => $menu,
@ -120,10 +119,10 @@ class ThemeEngine
$template = 'archive.twig';
$pageOptions = [
'debug' => true, // for theme kit
'theme' => $this->themeFolder , // for theme kit
'theme' => $this->themePath , // for theme kit
'title' => 'Archive',
'dynamicRender' => $this->settings['dynamicRender'],
'background' => $this->themeAsset Path . '/assets/images/global/default-bg.jpg',
'background' => $this->themePath . '/assets/images/global/default-bg.jpg',
'archives' => $archive['archives'],
'info' => $pageInfo,
'menu' => $menu,
@ -137,10 +136,10 @@ class ThemeEngine
$template = 'error.twig';
$pageOptions = [
'debug' => true, // for theme kit
'theme' => $this->themeFolder , // for theme kit
'theme' => $this->themePath , // for theme kit
'title' => 'Uh oh',
'dynamicRender' => $this->settings['dynamicRender'],
'background' => $this->themeAsset Path . '/assets/images/global/default-bg.jpg',
'background' => $this->themePath . '/assets/images/global/default-bg.jpg',
'info' => $pageInfo,
'content' => "This page is not defined",
'menu' => $menu,