-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
48 lines (35 loc) · 1.02 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
<?php
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/Application.php';
use Symfony\Component\HttpFoundation\Request;
$app = new Application();
$app['debug'] = true;
$app->register(new Silex\Provider\TwigServiceProvider(), [
'twig.path' => __DIR__.'/views',
]);
$app->extend('twig', function($twig, $app) {
$twig->addGlobal('nombreEmpresa', 'Lotería Santa Lucía');
return $twig;
});
$app->get('/', function() use ($app) {
return $app->render('welcome.twig');
});
$app->get('/feed', function() use ($app) {
return $app->render('index.twig');
});
$app->get('/profile', function() use ($app) {
return $app->render('profile.twig');
});
$app->get('/feed/1', function() use ($app) {
return $app->render('single_hash.twig');
});
// $app->get(
// '/pais/{paisId}/departamento',
// function($paisId) use ($app) {
// return $app->render(
// 'maestro/departamento/index.twig',
// ['paisId' => $paisId]
// );
// }
// );
$app->run();