Skip to content

Instantly share code, notes, and snippets.

@aambrozkiewicz
Created July 16, 2011 15:37
Show Gist options
  • Save aambrozkiewicz/1086459 to your computer and use it in GitHub Desktop.
Save aambrozkiewicz/1086459 to your computer and use it in GitHub Desktop.
aleksandera.pl under hood
<?php
require_once 'app/app.php';
require_once 'app/view.php';
$app = new app;
try {
$app->get('/404', function() {
echo view::render('views/404.php');
})->get('/(\w+)?', function($name = null) {
echo view::render('views/index.php', array(
'hacking' => $name
));
})->run();
} catch (HandlerNotFoundException $e) {
header("Location: /404");
} catch(Exception $e) {
die($e->getMessage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment