Skip to content

Instantly share code, notes, and snippets.

@cj
Created April 12, 2011 14:14
Show Gist options
  • Save cj/915556 to your computer and use it in GitHub Desktop.
Save cj/915556 to your computer and use it in GitHub Desktop.
<?
// Import Framework
require 'klein.php';
function visit($uri) {
return dispatch($uri, null, null, true);
}
respond('GET', '/[:name]?', function ($request, $response){
$name = $request->param('name', 'World');
$test= visit("/hello/$name");
echo "$test MOOO!";
});
respond('GET', '/hello/[:name]?', function ($request, $response){
$name = $request->param('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