Skip to content
Advertisement

Symfony knp_paginator query with $_GET

I am a beginner and I try to write a query for a search input using kpn_paginator but I get an error:

One of listeners must count and slice given target

I can not find the solution, I checked some other topic but cannot understand how to do it in my code.

My else work well but my if not.

When I try to change my query (->getOneOrNullResult) by (->getResult) I get this error:

Return value of AppRepositoryArticleRepository::findByName() must be an instance of AppEntityArticle or null, array returned

If you can help me thank you very much.

index.html.twig

JavaScript

Controller.php

JavaScript

ArticleRepository.php

JavaScript

Advertisement

Answer

Must to add join:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement