Created
November 12, 2015 23:17
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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