httpstatuses/index.php

26 lines
716 B
PHP
Raw Normal View History

2012-08-11 23:34:20 +02:00
<?php
require 'klein.php';
require 'httpstatuses.php';
require 'helper.php';
respond('/', function($request, $response) {
$class_list = Httpstatuses::statuses();
$response->render('views/index.php', array("class_list" => $class_list));
});
2012-08-12 02:10:30 +02:00
2012-08-11 23:34:20 +02:00
respond('/[i:id]', function($request, $response) {
$status_code = $request->param('id');
$code = Httpstatuses::status($status_code);
if(!$code)
$response->render('views/404.php');
$response->render('views/status_code.php', $code);
});
respond('404', function ($request, $response) {
$response->render('views/404.php');
});
dispatch();