Skip to content

Instantly share code, notes, and snippets.

@t-cyrill
Created July 23, 2014 04:30
Show Gist options
  • Save t-cyrill/bcb5c7eaa5665d95abae to your computer and use it in GitHub Desktop.
Save t-cyrill/bcb5c7eaa5665d95abae to your computer and use it in GitHub Desktop.
Klein.php sample2
<?php
header('Content-type: application/json');
$klein->respond('GET', '/users/[:id].[json:format]?', function ($req, $res, $serv, $app) {
$id = $req->param('id');
return json_encode(['id' => $id]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment