-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
23 lines (16 loc) · 794 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
<?php
define('ROOT', str_replace("index.php", "", $_SERVER["SCRIPT_FILENAME"]));
include_once 'vendor/autoload.php';
use App\Config\Route;
$router = new Route($_SERVER['REQUEST_URI'], $_SERVER['REQUEST_METHOD']);
// Blog Routes
$router->get('/', 'App\Controllers\BlogController@index');
$router->get('/create/blog', 'App\Controllers\BlogController@create');
$router->post('/create/blog', 'App\Controllers\BlogController@store');
$router->group('blog', function () use ($router) {
$router->get('{slug}', 'App\Controllers\BlogController@show');
$router->get('edit/{id}', 'App\Controllers\BlogController@edit');
$router->post('edit', 'App\Controllers\BlogController@update');
$router->get('delete/{id}', 'App\Controllers\BlogController@delete');
});
echo $router->action();