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],

Show english version

Související obsah

programovani

symfony

php

Komentáře

Vaše reakce na Symfony - Cannot autowire argument $paginator - it references interface - but no such service exists

Reference

Podívejte se na naše reference

Prohlédnout

Aplikace

Podívejte se na naše aplikace

Prohlédnout

Co umíme?

Podívejte se co umíme

Prohlédnout

Co umíme?

Vytváříme sofistikované aplikace pro náročné

Od webových aplikací přes android až po převodové můstky či složité informační systémy.

Podívejte se k nám

Máte ještě čas? Podívejte se na další rubriky

Tento web používá soubory cookie. Dalším procházením tohoto webu vyjadřujete souhlas s jejich používáním.. Více informací zde.