Skip to content

Instantly share code, notes, and snippets.

@mgirouard
Created March 21, 2012 13:25
Show Gist options
  • Save mgirouard/2146865 to your computer and use it in GitHub Desktop.
Save mgirouard/2146865 to your computer and use it in GitHub Desktop.
<?php
Example::app(function ($app) {
extract($app->load('request', 'response', 'security', 'error'));
$security->authenticated()
|| $error->send(302, '/login');
extract($app->load('router'));
file_exists($router->targetFile)
&& $response->send($router->targetFile)
$router->match($request->uri)
|| $error->send(404);
extract($app->load('controller', 'view'));
$controller->run() && $response->send($view);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment