summaryrefslogtreecommitdiff
path: root/htdocs
diff options
context:
space:
mode:
Diffstat (limited to 'htdocs')
-rw-r--r--htdocs/index.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/htdocs/index.php b/htdocs/index.php
new file mode 100644
index 0000000..84c4ff8
--- /dev/null
+++ b/htdocs/index.php
@@ -0,0 +1,28 @@
+<?php
+
+set_include_path(
+ get_include_path().PATH_SEPARATOR.realpath(__DIR__.'/..'));
+
+error_reporting(E_ALL);
+ini_set('display_errors', 1);
+
+spl_autoload_register(function($class) {
+ $path = __DIR__.'/../lib/'.$class.'.php';
+ if (is_file($path))
+ require_once $path;
+});
+
+SkinContext::setRootDirectory(realpath(__DIR__.'/../skin'));
+
+$skin = new Skin();
+$skin->title = 'hello world!';
+
+$cities = [
+ 'Moscow',
+ 'St. Petersburg',
+ '<b>New York</b>' // potential xss
+];
+echo $skin->renderPage('main/index',
+ name: "John",
+ show_cities: true,
+ cities: $cities);