forked from hasi94/google_sheet_php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
35 lines (31 loc) · 833 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
34
35
<?php
/**
* this is simple router for this application
*/
use Jenssegers\Blade\Blade;
$base_url = "/google_sheet/";
require __DIR__ . '/sheetController.php';
$request = $_SERVER['REQUEST_URI'];
$sheet_controller = new sheetController();
$blade = new Blade('views', 'cache');
switch ($request) {
case '/' :
$sheet_controller->readSheet();
break;
case '' :
$sheet_controller->readSheet();
break;
case $base_url :
$sheet_controller->readSheet();
break;
case $base_url.'write-sheet' :
$sheet_controller->writeSheet();
break;
case $base_url.'append-sheet' :
$sheet_controller->appendSheet();
break;
default:
http_response_code(404);
echo $blade->render('404',['url'=>$sheet_controller->url()]);
break;
}