Pleague v2.4를 Slim v3.8.1과 함께 사용하려면 어떻게해야합니까?Slim 3 + Pleague 2.4 - 별칭 (라우터)이 컨테이너에 의해 관리되고 있지 않습니까?
이 example에 따라, 나는 시도 :
// PSR 7 standard.
use Slim\Http\Request;
use Slim\Http\Response;
// Import classes.
use Slim\App as Slim;
use League\Container\Container;
$container = new Container;
// Required to enable auto wiring.
$container->delegate(
new \League\Container\ReflectionContainer
);
// Get an instance of Slim.
$app = new Slim($container);
내가 얻을 :
Fatal error: Uncaught League\Container\Exception\NotFoundException: Alias (router) is not being managed by the container in /var/www/html/projectA/vendor/league/container/src/Container.php:266 Stack trace: #0 /var/www/html/projectA/vendor/league/container/src/Container.php(93): League\Container\Container->getFromDelegate('router', Array) #1 /var/www/html/projectA/vendor/slim/slim/Slim/App.php(239): League\Container\Container->get('router') #2 /var/www/html/projectA/vendor/slim/slim/Slim/App.php(143): Slim\App->map(Array, '/', Object(Closure)) #3 /var/www/html/projectA/public/index.php(53): Slim\App->get('/', Object(Closure)) #4 {main} thrown in /var/www/html/projectA/vendor/league/container/src/Container.php on line 266
어떤 아이디어?
감사합니다! – laukok