Skip to content

Instantly share code, notes, and snippets.

@umpirsky
Created November 10, 2012 22:18
Show Gist options
  • Save umpirsky/4052740 to your computer and use it in GitHub Desktop.
Save umpirsky/4052740 to your computer and use it in GitHub Desktop.
<?php
use Silex\ControllerResolver as BaseControllerResolver;
/**
* Injects container into controllers.
*
* @author Саша Стаменковић <umpirsky@gmail.com>
*/
class ControllerResolver extends BaseControllerResolver
{
/**
* {@inheritdoc}
*/
protected function createController($controller)
{
$callable = parent::createController($controller);
$callable[0]->setContainer($this->app);
return $callable;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment