From 8cef0bf544f146aa3d04aa23b301536c64c366cd Mon Sep 17 00:00:00 2001 From: Jenga Phoenix Date: Mon, 11 Feb 2019 10:41:39 -0600 Subject: [PATCH] Add basic format --- index.php | 7 +++++++ public_html/index.php | 5 ----- res/lib/load.php | 14 ++++++++++++++ res/themes/default/html/index.twig.html | 1 + 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 index.php delete mode 100644 public_html/index.php diff --git a/index.php b/index.php new file mode 100644 index 0000000..b464ade --- /dev/null +++ b/index.php @@ -0,0 +1,7 @@ +render('index.twig.html', ['animal' => 'cat girl']); + +?> diff --git a/public_html/index.php b/public_html/index.php deleted file mode 100644 index f292231..0000000 --- a/public_html/index.php +++ /dev/null @@ -1,5 +0,0 @@ - - -Placeholder. diff --git a/res/lib/load.php b/res/lib/load.php index 62a2de0..afdfccf 100644 --- a/res/lib/load.php +++ b/res/lib/load.php @@ -1,3 +1,17 @@ PATH +// Take a path from root and turn it into a relative path. +function root($path) { + return $GLOBALS['depth'] . $path; +} + +// ------------------------------------- + +require_once root("vendor/autoload.php"); + +$loader= new Twig_Loader_Filesystem(root("res/themes/default/html")); +$twig = new Twig_Environment($loader, ['cache' => + root('cache/')]); + ?> diff --git a/res/themes/default/html/index.twig.html b/res/themes/default/html/index.twig.html index 978d7b8..c806fd0 100644 --- a/res/themes/default/html/index.twig.html +++ b/res/themes/default/html/index.twig.html @@ -6,5 +6,6 @@ Index +

{{ animal }}s are SUPER RAD.