0

我正在使用 symfony2.8,我想将knpPaginatorBundle添加到没有 composer.phar的现有项目中,因为我没有 SSH 访问权限

我已经下载了捆绑包.zip并将其放入供应商:

在此处输入图像描述

我在 appKernel 中激活了它,并在 config.yml 中添加了配置,并在 app/autoload.php 中声明了它,如下所示:

/** @var ClassLoader $loader */
$loader = require __DIR__.'/../vendor/autoload.php';

AnnotationRegistry::registerLoader([$loader, 'loadClass']);

$loader->add('PaginatorBundle',__DIR__ . '/../vendor/KnpPaginatorBundle');

return $loader;

但我得到这个错误:

致命错误:未捕获的 Symfony\Component\DependencyInjection\Exception\InvalidArgumentException:找不到用于服务“knp_paginator.subscriber.paginate”的类“Knp\Component\Pager\Event\Subscriber\Paginate\PaginationSubscriber”。在 /homepages/21/d676354179/htdocs/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php:105 堆栈跟踪:#0 /homepages/21/d676354179/htdocs/vendor/KnpPaginatorBundle/DependencyInjection /Compiler/PaginatorConfigurationPass.php(24): Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass->process(Object(Symfony\Component\DependencyInjection\ContainerBuilder)) #1 /homepages/21/d676354179/htdocs/vendor/symfony/symfony /src/Symfony/Component/DependencyInjection/Compiler/Compiler.php(120):

4

0 回答 0