-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There are no registered paths for namespace "KnpPaginator". #591
Comments
I'm afraid that templates are not automatically discovered before Symfony 4.4 |
I just tried on a project with Symfony 4.4 and KnpPaginatorBundle 5.0 and I can confirm that it's working |
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. |
What do you mean? As already mentioned, I can't reproduce this problem on Symfony 4.4/KnpPaginatorBundle 5.0 |
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 |
Please provide output for |
I can reproduce the funcionality on Symfony 5, so I have to close this issue. composer create-project symfony/website-skeleton mybigproject
cd mybigproject
composer require knplabs/knp-paginator-bundle symfony/web-server-bundle:^4.4
vi config/packages/knp_paginator.yaml # add configuration as above
bin/console make:controller
vi src/Controller/VictoriousKangarooController.php #edit as below
vi templates/victorious_kangaroo/index.html.twig #edit as below here is the controller <?php
namespace App\Controller;
use Knp\Component\Pager\PaginatorInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Request;
class VictoriousKangarooController extends AbstractController
{
/**
* @Route("/victorious/kangaroo", name="victorious_kangaroo")
*/
public function index(PaginatorInterface $paginator, Request $request)
{
$pagination = $paginator->paginate(range(1, 99), $request->query->getInt('page', 1));
return $this->render('victorious_kangaroo/index.html.twig', [
'controller_name' => 'VictoriousKangarooController',
'pagination' => $pagination,
]);
}
} in template, just add |
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. |
Just add
to twig.yaml https://symfony.com/doc/4.1/templating/namespaced_paths.html#registering-your-own-namespaces |
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:
As far as I can debug, it looks like it can't find the directory to load the template correctly.
The text was updated successfully, but these errors were encountered: