Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Knp Paginator Bundle Laravel Package

knplabs/knp-paginator-bundle

View on GitHub
Deep Wiki
Context7

Configuring paginator

There's an easy way to configure paginator - just add a knp_paginator entry to your configuration and change default values. Location of your configuration file depends on your Symfony versions: most common places are config/packages/knp_paginator.yaml for recent versions of Symfony and app/config.yml for older versions. If you can't find a configuration file, you can create it.

Default options

knp_paginator:
    page_range: 5                      # default page range used in pagination control
    page_limit: 100                    # page limit for pagination control; to disable set this field to ~ (null)
    convert_exception: false           # convert paginator exception (e.g. non-positive page and/or limit) into 404 error
    default_options:
        page_name: page                # page query parameter name
        sort_field_name: sort          # sort field query parameter name; to disable sorting set this field to ~ (null)
        sort_direction_name: direction # sort direction query parameter name
        distinct: true                 # ensure distinct results, useful when ORM queries are using GROUP BY statements
        page_out_of_range: ignore      # if page number exceeds the last page. Options: 'fix'(return last page); 'throwException'
        default_limit: 10              # default number of items per page
    template:
        pagination: [@KnpPaginator](https://github.com/KnpPaginator)/Pagination/sliding.html.twig     # sliding pagination controls template
        rel_links: [@KnpPaginator](https://github.com/KnpPaginator)/Pagination/rel_links.html.twig     # <link rel=...> tags template
        sortable: [@KnpPaginator](https://github.com/KnpPaginator)/Pagination/sortable_link.html.twig # sort link template

There are a few additional pagination templates, that could be used out of the box in knp_paginator.template.pagination key:

  • [@KnpPaginator](https://github.com/KnpPaginator)/Pagination/sliding.html.twig (by default)
  • [@KnpPaginator](https://github.com/KnpPaginator)/Pagination/bootstrap_v5_pagination.html.twig
  • [@KnpPaginator](https://github.com/KnpPaginator)/Pagination/twitter_bootstrap_v4_pagination.html.twig
  • [@KnpPaginator](https://github.com/KnpPaginator)/Pagination/foundation_v6_pagination.html.twig
  • [@KnpPaginator](https://github.com/KnpPaginator)/Pagination/foundation_v5_pagination.html.twig
  • [@KnpPaginator](https://github.com/KnpPaginator)/Pagination/bulma_pagination.html.twig
  • [@KnpPaginator](https://github.com/KnpPaginator)/Pagination/semantic_ui_pagination.html.twig
  • [@KnpPaginator](https://github.com/KnpPaginator)/Pagination/tailwindcss_pagination.html.twig
  • [@KnpPaginator](https://github.com/KnpPaginator)/Pagination/uikit_v3_pagination.html.twig
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
phalcon/cli-options-parser
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
directorytree/privacy-filter-classifier
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata