-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
33 lines (23 loc) · 857 Bytes
/
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
<?php
require_once 'Views/Twig/Autoloader.php';
Twig_Autoloader::register();
require 'Slim/Slim.php';
require 'Views/TwigView.php';
require 'lib/database.php';
$app = new Slim(array('view' => 'TwigView', 'http.version' => '1.0'));
$app->get('/', function() use($app) {
$app->redirect('wishlist');
});
$app->get('/wishlist(/:order)', function($order = 'year') use($app) {
$app->etag('wishlist');
$albums = Database::getAlbums('wishlist', $order);
$data = array('albums' => $albums, 'page' => 'wishlist', 'order' => $order);
$app->render('index.html', $data);
});
$app->get('/coleccao(/:order)', function($order = 'year') use($app) {
$app->etag('coleccao');
$albums = Database::getAlbums('collection', $order);
$data = array('albums' => $albums, 'page' => 'coleccao', 'order' => $order);
$app->render('index.html', $data);
});
$app->run();