KnpPaginatorBundle: Template not working

Hello,

I have updated Symfony to 5.1.2 and the template of KnpPaginator don’t working anymore.

And a new deprecation appeared :

User Deprecated: Since symfony/event-dispatcher 5.1: Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy is deprecated, use the event dispatcher without the proxy.

Anyone have a solution?

Thank you.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 29

Most upvoted comments

I succeeded, just I added this in my config>packages>twig.yaml:

paths: 
       '%kernel.project_dir%/vendor/knplabs/knp-paginator-bundle/templates': KnpPaginator

And it works, however I still have the depreciation:

User Deprecated: Since symfony/event-dispatcher 5.1: Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy is deprecated, use the event dispatcher without the proxy.

Just in case anyone has the same Error as @Crayzo In ConfigDebugCommand.php line 104: The extension with alias "knp_paginator" does not have configuration. after upgrading Symfony to version 5: Check the file-extension of your KnpPaginatorBundle config. YAML files are now required to have the extension .yaml. .yml is not supported anymore.

thanks @Crayzo works for me to 😃 maybe add this line in the doc ?

Hello same problem here … if I use the template directly in twig like this ({{ knp_pagination_render(meetings, '@KnpPaginator/Pagination/twitter_bootstrap_v4_pagination.html.twig') }} ) it works fine but from configuration it’s the same like @Crayzo my result of the command if it can help :

Current configuration for extension with alias "knp_paginator"
==============================================================

knp_paginator:
    page_range: 5
    default_options:
        page_name: page
        sort_field_name: sort
        sort_direction_name: direction
        distinct: true
        filter_field_name: filterField
        filter_value_name: filterValue
    template:
        pagination: '@KnpPaginator/Pagination/twitter_bootstrap_v4_pagination.html.twig'
        sortable: '@KnpPaginator/Pagination/twitter_bootstrap_v4_font_awesome_sortable_link.html.twig'
        filtration: '@KnpPaginator/Pagination/filtration.html.twig'
    page_limit: null