-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroutes.php
More file actions
33 lines (31 loc) · 1019 Bytes
/
routes.php
File metadata and controls
33 lines (31 loc) · 1019 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
<?php declare(strict_types=1);
/**
* Routes definitions of the project
*
* This file contains all the (SEO friendly) URLs of the project
*
* PHP version 7.0
*
* @category Demo
* @author Pieter Hordijk <info@pieterhordijk.com>
* @copyright Copyright (c) 2015 Pieter Hordijk <https://pieterhordijk.com>
* @license See the LICENSE file
* @version 1.0.0
*/
namespace Demo;
$router
->get('/not-found', ['Demo\Presentation\Controller\Error', 'notFound'])
->get('/method-not-allowed', ['Demo\Presentation\Controller\Error', 'methodNotAllowed'])
;
if (!$user->isLoggedIn()) {
$router
->get('/', ['Demo\Presentation\Controller\User', 'login'])
->post('/', ['Demo\Presentation\Controller\User', 'doLogin'])
->get('/cookie-login', ['Demo\Presentation\Controller\User', 'doCookieLogin'])
;
} else {
$router
->get('/', ['Demo\Presentation\Controller\Index', 'index'])
->post('/logout', ['Demo\Presentation\Controller\User', 'doLogout'])
;
}