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