Slide 47
Slide 47 text
ルーティングの実装
$pattern = [
'/' => [
'method' => 'GET',
'controller' => 'HomeController',
'action' => 'index',
],
'/blog' => [
'method' => 'GET',
'controller' => 'BlogController',
'action' => 'index',
],
// 省略
];
$router = new Router($pattern);
$router->response($_SERVER['REQUEST_URI']);
html/index.phpの抜粋