Symfony - Cannot autowire argument $paginator - it references interface - but no such service exists

Symfony - Cannot autowire argument $paginator - it references interface - but no such service exists

Dobrý den,

poté co jsem v Symfony promazal cache php bin/console cache:pool:clear cache.global_clearer, tak přestal fungovat balíček Knp\Component\Pager\PaginatorInterface s chybou:

Cannot autowire argument $paginator of "App\Controller\DataController::index()": it references interface "Knp\Component\Pager\PaginatorInterface" but no such service exists. Did you create a class that implements this interface?


Kernel->handle()
in public/index.php (line 28)
Request::setTrustedHosts([$trustedHosts]);}$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);$request = Request::createFromGlobals();$response = $kernel->handle($request);$response->send();$kernel->terminate($request, $response);

ODPOVĚĎ


Dobrý den,

chybu Cannot autowire argument $paginator of "App\Controller\DataController::index()": it references interface "Knp\Component\Pager\PaginatorInterface" but no such service exists. Did you create a class that implements this interface?

jsem vyřešil původně tak, že jsem odebral balíček knplabs/knp-paginator-bundle a pak ho zase přidal:

composer remove knplabs/knp-paginator-bundle
composer require knplabs/knp-paginator-bundle

V tu chvíli to jelo....

Nicméně problém byl celou dobu v tom, že jsem si neustále přepisoval bundes.php, chybělo tam:
Knp\Bundle\PaginatorBundle\KnpPaginatorBundle::class => ['all' => true],

Jak se ti článek líbil?

Komentáře (0)

Přidat komentář