readme musings

This commit is contained in:
Samuel Ryan 2012-08-12 01:10:30 +01:00
parent b0504525e1
commit 64caed92cd
4 changed files with 7 additions and 10 deletions

View File

@ -64,6 +64,10 @@ turning new lines into linebreaks, if you wish to include HTML that's fine
- Add some sort of "global reference" system, where a code reference can be
added that applies to all status codes based on a property, eg: adding an http
status cats (http://httpcats.herokuapp.com/) link to each code page
- configure httpstatuses.com to redirect
- Decide on whether or not to add a method to return a specific class of error
codes, eg: 4xx, 5xx. Not sure if httpstatus.es/{class} makes sense (eg:
httpstatus.es/5) or httpstatus.es/{class}xx (eg: httpstatus.es/5xx)
## notes

View File

@ -4,7 +4,7 @@ class Httpstatuses
{
public static function statuses($class = "*")
{
$class_files = glob("codes/*.json");
$class_files = glob("codes/$class.json");
foreach($class_files as $class_file)
{

View File

@ -9,19 +9,12 @@
$response->render('views/index.php', array("class_list" => $class_list));
});
respond('/generator', function($request, $response) {
// generator here
});
respond('/[i:id]', function($request, $response) {
$status_code = $request->param('id');
$code = Httpstatuses::status($status_code);
if(!$code)
{
$response->code(404);
$response->render('views/404.php');
}
$response->render('views/status_code.php', $code);
});

View File

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<title>(Actual) 404 &mdash; httpstatus.es</title>
<title>404real &mdash; httpstatus.es</title>
<link rel="stylesheet" href="assets/css/style.min.css" type="text/css" />
<script type="text/javascript">