Skip to content

Instantly share code, notes, and snippets.

@cj
Created April 10, 2011 23:35
Show Gist options
  • Save cj/912850 to your computer and use it in GitHub Desktop.
Save cj/912850 to your computer and use it in GitHub Desktop.
<?
// Import Framework
require 'klein.php';
function visit($uri) {
return dispatch($uri, 'GET', null, true);
}
respond('GET', '/', function ($request, $response) {
// It shouldn't print Hello World to the browser, but it does.....
$test= visit("/hello");
});
respond('GET', '/hello?', function ($request, $response) {
$name = 'World';
echo "Hello $name!";
});
// Run App
dispatch();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment