Skip to content

Instantly share code, notes, and snippets.

@bobagold
Created November 27, 2012 07:41
Show Gist options
  • Select an option

  • Save bobagold/4152987 to your computer and use it in GitHub Desktop.

Select an option

Save bobagold/4152987 to your computer and use it in GitHub Desktop.
Oppa js style (silex-based skeleton without unintended global variables
<?php
return call_user_func(function() {
$app = new \Silex\Application();
$routes = require(__DIR__ . '/routes.php');
$routes($app);
return $app;
});
<?php
use \Symfony\Component\HttpFoundation\Response;
return function(\Silex\Application $app) {
$app->get('/', function() {
return new Response('');
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment