Hello Friends,
If you are looking to implement paging in Symfony2, please review the code below and adjust your code accordingly.
$data = $this->get('app_cam_taxsetting.taxsetting_repository.taxsetting')->getUserList();
// app_cam_taxsetting.taxsetting_repository.taxsetting = My Repository NAMESPACE
// getUserList() return all my users data
$paging_data = $this->get('knp_paginator')->paginate($data, $page, 100);
return $this->render('AppCamTaxsettingBundle:Taxsetting:userList.html.twig', [
'data' => $paging_data,
]);
0 Comment(s)