Browse code

Add basic format

Jenga Phoenix authored on 2019-02-11 16:41:39
Showing 4 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,7 @@
1
+<?php
2
+$depth = "";
3
+include "res/lib/load.php";
4
+
5
+echo $GLOBALS['twig']->render('index.twig.html', ['animal' => 'cat girl']);
6
+
7
+?>
0 8
deleted file mode 100644
... ...
@@ -1,5 +0,0 @@
1
-<?php
2
-require_once 'vendor/autoload.php'
3
-?>
4
-
5
-Placeholder.
... ...
@@ -1,3 +1,17 @@
1 1
 <?php
2 2
 
3
+// PATH --> PATH
4
+// Take a path from root and turn it into a relative path.
5
+function root($path) {
6
+	return $GLOBALS['depth'] . $path;
7
+}
8
+
9
+// -------------------------------------
10
+
11
+require_once root("vendor/autoload.php");
12
+
13
+$loader= new Twig_Loader_Filesystem(root("res/themes/default/html"));
14
+$twig = new Twig_Environment($loader, ['cache' =>
15
+	root('cache/')]);
16
+
3 17
 ?>
... ...
@@ -6,5 +6,6 @@
6 6
 	<title>Index</title>
7 7
 </head>
8 8
 <body>
9
+	<p>{{ animal }}s are SUPER RAD.</p>
9 10
 </body>
10 11
 </html