我正在使用symfony2.8并且我想将 knpPaginatorBundle 添加到现有项目而不使用composer.phar ,因为我不喜欢#39; t具有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:Class" Knp \ Component \ Pager \ Event \ Subscriber \ Paginate \ PaginationSubscriber"用于服务" knp_paginator.subscriber.paginate"无法找到。在/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):Knp \ Bundle \ PaginatorBundle \ DependencyInjection \ Compiler \ PaginatorConfigurationPass-> process(Object(Symfony \ Component \ DependencyInjection \ ContainerBuilder))#2 / homepages / 21 / d676354179 / htdocs / vendor / symfony / symfony / src / Symfony / Componen in /homepages/21/d676354179/htdocs/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php on 105