-
Notifications
You must be signed in to change notification settings - Fork 0
/
zyte.init.php
66 lines (57 loc) · 1.43 KB
/
zyte.init.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
<?php
require_once dirname(__FILE__) . '/zyte.autoload.php';
date_default_timezone_set('Europe/Oslo');
error_reporting(E_ALL);
use Zyte\Zyte as Zyte;
# CREATE PAGE OBJECT
$zyte = new Zyte($crossOrigin);
# ROUTES
# LOGIN / LOGOUT
$zyte->post([
'route' => '/login/{type:^[a-z]+$}',
'controller' => 'LoginController'
]);
$zyte->get([
'route' => '/logout/{type:^[a-z]+$}',
'controller' => 'LogoutController'
]);
# REGISTRATION
$zyte->post([
'route' => '/register',
'controller' => 'RegisterController'
]);
$zyte->put([
'route' => '/register/{id:^[0-9]+$}/{code:^[a-zA-Z0-9]+$}',
'controller' => 'VerifyRegisterController'
]);
# AUTHENTICATION
$zyte->get([
'route' => '/auth/{type:^[a-z]+$}/[company:^[a-zA-Z-]+$]',
'controller' => 'AuthController'
]);
# PASSWORD RECOVERY / CHANGE
$zyte->post([
'route' => '/password/{action:^[a-zA-Z-]+$}',
'controller' => 'PasswordController'
]);
# PROJECTS
$zyte->get([
'route' => '/projects/{start:^[0-9-]+$}/{end:^[0-9-]+$}',
'controller' => 'ProjectsController'
]);
$zyte->route([
'route' => '/project/{id:^[0-9]+$}',
'method' => ['GET', 'PUT', 'POST', 'DELETE'],
'controller' => 'ProjectController'
]);
$zyte->get([
'route' => '/plans/{start:^[0-9-]+$}/{end:^[0-9-]+$}',
'controller' => 'PlansController'
]);
$zyte->route([
'route' => '/plan/{id:^[0-9]+$}',
'method' => ['GET', 'PUT', 'POST', 'DELETE'],
'controller' => 'PlanController'
]);
# RENDER PAGE
$zyte->render();