From 21df13f3c3754ac145dc698c59901691c718d366 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 28 Jan 2016 10:38:52 +0100 Subject: [PATCH] pager --- lib/project.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/project.php b/lib/project.php index e8ca80d..feec26a 100644 --- a/lib/project.php +++ b/lib/project.php @@ -72,7 +72,7 @@ function getProjectNumberOfPages($maxPerPage) $result = $query->fetch(); - return ceil($result['total'] / $maxPerPage); + return (int) ceil($result['total'] / $maxPerPage); } /** @@ -88,6 +88,13 @@ function getCommentsByProject($id) // Prévoir une fonction pour enregistrer un commentaire +/** + * Génère et retourne une pagination + * + * @param int $page La page courrante + * @param int $numberOfPages Le nombre de pages + * @return array Les pages + */ function getProjectsPager($page, $numberOfPages) { $pages = [];