summaryrefslogtreecommitdiff
path: root/htdocs/index.php
blob: 84c4ff8637650e02bc5649d1b835571e572ef419 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);