I require setting the package in a disconnected environment. I have read some special web sites that talks about it, but in previous versions.
I'm using Symfony 2.4.1, recently downloaded. The KnpPaginatorBundle package I downloaded today exactly.
I extracted the master.zip, with this folder inside: "KnpPaginatorBundle-master", from GitHub repository and assumed this structure:
\vendor\Knp\Bundle\PaginatorBundle
I received this error:
ClassNotFoundException: Attempted to load class "KnpPaginatorBundle" from namespace "Knp\Bundle\PaginatorBundle" in C:\EasyPHP-DevServer-14.1VC11\data\localweb\projects\sf_zktime\app\AppKernel.php line 20. Do you need to "use" it from another namespace?
This is the line 20 in App_Kernel.php:
new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),//Paginator
This is my local path in vendors packages:
C:\EasyPHP-DevServer-14.1VC11\data\localweb\projects\sf_zktime\vendor\Knp\Bundle\PaginatorBundle
This is my config.yml parameters:
knp_paginator:
page_range: 5 # número de páginas que se muestran en el paginador
default_options:
# los siguientes tres parámetros permiten "traducir" el paginador
# puedes utilizar por ejemplo: 'pagina', 'ordenar' y 'direccion'
page_name: page
sort_field_name: sort
sort_direction_name: direction
# sólo incluir resultados diferentes (útil cuando haces consultas GROUP BY)
distinct: true
template:
# estas opciones configuran la plantilla utilizada para la paginación
# y para los controles que premiten reordenar los resultados
pagination: KnpPaginatorBundle:Pagination:sliding.html.twig
sortable: KnpPaginatorBundle:Pagination:sortable_link.html.twig
It's a mix between these references:
http://symfony.es/bundles/knplabs/knppaginatorbundle/instalacion-en-symfony-2-1 https://github.com/KnpLabs/KnpPaginatorBundle/
Edit
vendor/composer/autoload_namespaces.php
and add this line:EDIT: Move your plugin folder to
vendor/knplabs/knp-paginator-bundle/
, so now the real path would be:vendor/knplabs/knp-paginator-bundle/Knp/Bundle/PaginatorBundle/
.Then delete cache and reload the web server.