Skip to content

Instantly share code, notes, and snippets.

@danielgsims
Created May 5, 2014 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielgsims/b9e5ad85cf30a5c5ece7 to your computer and use it in GitHub Desktop.
Save danielgsims/b9e5ad85cf30a5c5ece7 to your computer and use it in GitHub Desktop.
Container Resolver
$app = new \Slim\App();
$app['resolver'] = new \Slim\Resolvers\ContainerResolver($app);
$app->get('/', 'MyController:index');
$app->run();
class MyController
{
protected $app;
public function __construct(\Pimple $app)
{
$this->app = $app;
}
public function index()
{
$this->app['response']->write('Hello World');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment