I'm getting an error with rendering knp paginator:
An exception has been thrown during the rendering of a template ("Catchable Fatal Error: Argument 2 passed to Knp\Bundle\PaginatorBundle\Twig\Extension\PaginationExtension::render() must be an instance of Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination, array given, called in C:\wamp\www\TunisiaMall\app\cache\dev\twig\7b\87\136d965ad591aa95bee5c88d324ab4fe15f38a8af882bbdb9ef9f4ac9320.php on line 78 and defined in C:\wamp\www\TunisiaMall\vendor\knplabs\knp-paginator-bundle\Twig\Extension\PaginationExtension.php line 43") in TMallClientBundle:Default:detailBoutique.html.twig at line 29.
here is code for the controller:
public function boutiqueDetailAction(){
$em = $this->getDoctrine()->getManager();
$boutiq = $em->getRepository("TMallEntityBundle:boutique")->findAll();
$boutique = $this->get('knp_paginator')->paginate(
$boutiq,
$this->get('request')->query->get('page', 1)/*page number*/,
2/*limit per page*/
);
return $this->render("TMallClientBundle:Default:detailBoutique.html.twig",array("boutiques"=>$boutiq));
}
View. Can you show your Twig template? - Imanali Mamadiev