Skip to content

Instantly share code, notes, and snippets.

@russ
Created February 10, 2011 18:23
Show Gist options
  • Save russ/821033 to your computer and use it in GitHub Desktop.
Save russ/821033 to your computer and use it in GitHub Desktop.
<?
require "_application.php";
hydra_import_package("HydraDispatch");
$d = new HydraDispatch();
$d->dispatch("/", function($r) use ($d, $db) {
$result = $db->execute("SELECT (1 + 1) AS count");
return $d->html(
"views/home.php",
"views/application.php",
array( "result" => $result ));
});
$d->dispatch("/preview", function($r) use ($d) {
return $d->html(
"views/preview.php",
"views/application.php",
array( "time" => time() ));
});
$d->run();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment