-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
42 lines (32 loc) · 867 Bytes
/
index.php
File metadata and controls
42 lines (32 loc) · 867 Bytes
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
require 'vendor/autoload.php';
$loader = new Twig\Loader\FilesystemLoader(dirname(__FILE__));
$twig = new Twig\Environment($loader, [
'cache' => dirname(__FILE__) . '/cache',
'debug' => str_contains($_SERVER['HTTP_HOST'], 'localhost'),
]);
$mDateFilter = new Twig\TwigFilter('mdate', function ($input) {
$time = strtotime($input);
$months = [
'Jan',
'Feb',
'Mär',
'Apr',
'Mai',
'Jun',
'Jul',
'Aug',
'Sep',
'Okt',
'Nov',
'Dez',
];
$monthIndex = intval(date('n', $time)) - 1;
return $months[$monthIndex] . ' ' . date('Y', $time);
});
$twig->addFilter($mDateFilter);
$template = $twig->load('index.html.twig');
$resume = json_decode(file_get_contents(dirname(__FILE__) . '/resume.json'));
print $template->render([
'resume' => $resume,
]);