-
Notifications
You must be signed in to change notification settings - Fork 342
Closed
Description
Hi o/
I'm running an app in symfony (v4.3) with knplabs/knp-paginator-bundle
The following error occurs in v5.0, but works normally in previous v4.1.
Is there anything different I should know to use this version? Or is this a bug ?!
Controller:
Repository:
knp_paginator.yaml:
knp_paginator:
page_range: 10 # number of links showed in the pagination menu (e.g: you have 10 pages, a page_range of 3, on the 5th page you'll see links to page 4, 5, 6)
default_options:
page_name: page # page query parameter name
sort_field_name: sort # sort field query parameter name
sort_direction_name: direction # sort direction query parameter name
distinct: true # ensure distinct results, useful when ORM queries are using GROUP BY statements
filter_field_name: filterField # filter field query parameter name
filter_value_name: filterValue # filter value query parameter name
template:
pagination: '@KnpPaginator/Pagination/twitter_bootstrap_v4_pagination.html.twig' # sliding pagination controls template
sortable: '@KnpPaginatorBundle/Pagination/sortable_link.html.twig' # sort link template
filtration: '@KnpPaginatorBundle/Pagination/filtration.html.twig' # filters template
As far as I can debug, it looks like it can't find the directory to load the template correctly.
Activity
garak commentedon Nov 28, 2019
I'm afraid that templates are not automatically discovered before Symfony 4.4
If you can't upgrade Symfony, you'll need to manually add bundle path to your paths.
garak commentedon Nov 30, 2019
I just tried on a project with Symfony 4.4 and KnpPaginatorBundle 5.0 and I can confirm that it's working
agent44 commentedon Dec 3, 2019
I am experiencing the same issue in Symfony 4.4 and KnpPaginatorBundle 5.0
The Symfony version has just been upgraded, which seems to have caused this issue.
garak commentedon Dec 3, 2019
What do you mean?
As already mentioned, I can't reproduce this problem on Symfony 4.4/KnpPaginatorBundle 5.0
agent44 commentedon Dec 3, 2019
I have a Symfony instance that . has just been upgraded to 4.4 and KnpPaginatorBundle and I have had to manually register the twig namespace to make it work. I have the same issue with Symfony v 5
garak commentedon Dec 3, 2019
Please provide output for
console de:conf twig
garak commentedon Dec 4, 2019
I can reproduce the funcionality on Symfony 5, so I have to close this issue.
If you're able to reproduce it, feel free to re-open.
Here are steps for a minimal Symfony 5 project that is able to run this bundle:
here is the controller
in template, just add
{{ knp_pagination_render(pagination) }}
avandrevitor commentedon Dec 9, 2019
Thank you @garak
I did some tests and managed to run normally with a new instance of symfony (4.4 and 5.0). Apparently my problem comes from the conflict of another bundle.
I'm debugging to better understand what happens with this legacy application.
Evgeny1973 commentedon Jan 10, 2020
Just add
to twig.yaml
https://symfony.com/doc/4.1/templating/namespaced_paths.html#registering-your-own-namespaces