$data = $dataService->getData();
// print_r($data);
$arr = $data['data']['builder'];
return $this->render('builders/index.html.twig',['names' => $arr,
'data' => $data['outcome'] == 'success' ? $data['data'] : array()
]);
public function index(Request $request, int $page) {
$data = $dataService->getPage($page);
return $this->render('builders/index.html.twig', [
'data' => $data,
]);
}
public function getPage(int $page) {
$pageSize = 10;
$offset = $page > 0 $pageSize * ($page - 1) : 0;
// SELECT * FROM table OFFSET $offset LIMIT $pageSize
return $query->getResult();
}