Skip to content

Instantly share code, notes, and snippets.

@dhrrgn
Created November 12, 2015 23:17
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 dhrrgn/fd1a44efa52c70101f5c to your computer and use it in GitHub Desktop.
Save dhrrgn/fd1a44efa52c70101f5c to your computer and use it in GitHub Desktop.
Not sure why @slimphp v3 doesn't add the App instance to the Container, but…here is how to do it if you want
<?php
namespace Core;
use Interop\Container\ContainerInterface;
use Slim\App;
class Application extends App {
/**
* @param ContainerInterface|array $container
*/
public function __construct($container = [])
{
parent::__construct($container);
$this->getContainer()['app'] = function () { return $this; };
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment