-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.php
49 lines (37 loc) · 1.04 KB
/
app.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
<?php
################
# Конфигурация #
################
// временная зона
date_default_timezone_set('Europe/Moscow');
// Twig
$twig_view = new \Slim\Views\Twig();
$log_writer = new \Slim\LogWriter(fopen('log/slim_error.log', 'a'));
// общая конфигурация
$app = new \Slim\Slim(array(
'mode' => $ENV,
'view' => $twig_view,
'templates.path' =>'templates',
'upload.path' => 'uploads',
'log.writer' => $log_writer
) + $config);
########
# Виды #
########
require_once 'views/lot.php';
require_once 'views/video.php';
require_once 'views/order.php';
require_once 'views/feedback.php';
// админ
$app->group('/admin', function () use ($app) {
require_once 'views/admin/lot.php';
// редирект с главной
$app->get('/', function () use ($app) {
$app->redirect($app->urlFor('lots'));
});
// данные для всех видов
$app->view->appendData(array(
'project_title'=> 'Biganto::Бэкенд',
'app'=> $app
));
});