-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·85 lines (59 loc) · 1.7 KB
/
index.php
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
require_once __DIR__.'/vendor/Silex/silex.phar';
require_once __DIR__.'/src/lib/Algorithms.php';
require_once __DIR__.'/src/lib/Crossings.php';
require_once __DIR__.'/src/lib/Mutations.php';
require_once __DIR__.'/src/lib/Selections.php';
require_once __DIR__.'/src/index.php';
$app = new Silex\Application();
//$app['debug'] = true;
// $app['autoloader']->registerNamespaces(array(
// 'ISA' => __DIR__.'/src',
// ));
$app->register(new Silex\Provider\TwigServiceProvider(), array(
'twig.path' => __DIR__.'/resources/views',
'twig.class_path' => __DIR__.'/vendor/twig/lib',
));
$app->before(function () use ($app) {
$app['twig']->addGlobal('base', $app['twig']->loadTemplate('base.html.twig'));
});
$app->get('/lab1', function () use ($app) {
$laboratorium = new ISA\Laboratorium();
$result = $laboratorium->lab1($app);
return $app['twig']->render(
'lab1.html.twig',
$result
);
});
$app->get('/lab2', function () use ($app) {
$laboratorium = new ISA\Laboratorium();
$result = $laboratorium->lab2($app);
return $app['twig']->render(
'lab2.html.twig',
$result
);
});
$app->get('/lab3', function () use ($app) {
$laboratorium = new ISA\Laboratorium();
$result = $laboratorium->lab3($app);
return $app['twig']->render(
'lab3.html.twig',
$result
);
});
$app->get('/lab4', function () use ($app) {
return $app['twig']->render('lab4.html.twig');
});
$app->get('/lab5', function () use ($app) {
$laboratorium = new ISA\Laboratorium();
$result = $laboratorium->lab5($app);
return $app['twig']->render(
'lab5.html.twig',
$result
);
});
$app->get('/', function () use ($app) {
return $app['twig']->render('isa.html.twig', array());
});
$app->run();
?>