Menu
  • HOME
  • TAGS

KNP Pagination links stucked on page 1

symfony2,hyperlink,pagination,knppaginator

Ok so I found THE or ONE solution to my problem. In fact as I said in my previous comments, the issue seemed to come from the routing. Knp bundle did effectively not appreciate the index route. Therefore, I have modified my controller in order to make a redirection with...

knp_paginator failed to open stream

symfony2,knppaginator

Update config.yml knp_paginator: .... template: # Following two lines were present before Symfony 2.6 upgrade. # Commented out to load from default location. # pagination: KnpPaginatorBundle:Pagination:sliding.html.twig # sliding pagination # sortable: KnpPaginatorBundle:Pagination:sortable_link.html.twig # sort link template Then sudo rm -rf app/cache/prod app/console cache:clear –env=prod (same for –-env=dev) both http://mysite/app_dev.php/media/gallery/24223?page=5&count=82&number=1752&series=FIAGT&season=2009 and...

create and retrieve sortable options list with KnpPaginatorBundle

php,symfony2,knppaginator

This happens because you are sending the form, I wrote you a piece of JS in your previous question which: Gets the value of the selected option in eg. localhost/agence/web/app_dev.php/travels?sort=country&direction=desc Redirect to the page you retrieved from the value. I think it might also not work because KNPPaginator default template...

JMS Serializer ignores mappings for Knp Paginator

jmsserializerbundle,knppaginator

The properties that you want to map are owned by Knp\Component\Pager\Pagination\AbstractPagination. You also want to hide the rest of properties, so you will have to configure both classes. I've just tried the following and it's working for me. app/config/config.yml jms_serializer: metadata: directories: KnpPaginatorBundle: namespace_prefix: Knp\Bundle\PaginatorBundle path: %kernel.root_dir%/config/serializer/KnpPaginatorBundle KnpPager: namespace_prefix: Knp\Component\Pager...

KNPPaginatorBundle Featured Results on First Page

symfony2,knppaginator

The best way it to create a Query with 'featured' items first. (order by?). If, for some reason you are not able to create such query, but you have items, you can pass collection to paginate directly: $collection = new \Doctrine\Common\Collections\ArrayCollection($featured); foreach ($items as $item) { $collection->add($item); } $pagination =...

how to downgrade symfony2 bundles knp_compnent?

symfony2,knppaginator

You didn't tell us which version currently do you have or to which version you would like to downgrade for that matter. However, follow these simple steps: Go to Packagist's knp-components page Find the exact version you would like to downgrade to Put that version tag into your composer.json Run...

Is there a way to make the knp paginator show only show next and previous buttons

symfony2,pagination,twig,knppaginator

One way to do that is override twig file. Find file sliding.html.twig and copy it into app/Resources/KnpPaginatorBundle/views/Pagination and remove everything you don't need. If you want only next and previous buttons then solution is: {# default Sliding pagination control implementation #} {% if pageCount > 1 %} <div class="pagination"> {%...

Show how many pages in Knp pagination

symfony2,knppaginator

You can override this template : https://github.com/KnpLabs/KnpPaginatorBundle/blob/master/Resources/views/Pagination/sliding.html.twig Just use the variable pageCount to display the amount of pages where you want. To do so, create a sliding.html.twig file in your app/Resources/KnpPaginatorBundle/views/Pagination folder....