From ca3bf92fa9b194e057a7914bd57693a467c28fd2 Mon Sep 17 00:00:00 2001 From: Ashley Dawson Date: Thu, 25 Jan 2018 20:57:55 +0000 Subject: [PATCH] Added before and after query callbacks --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index f45f7fb..4cad745 100644 --- a/README.md +++ b/README.md @@ -240,6 +240,23 @@ $pagination = $paginator->paginate((int) $_GET['page']); var_dump($pagination->getMeta()); ``` +Pre and Post Query Callbacks +---------------------------- + +Before and after the count and slice queries, you can set callbacks to fire. To set them, do the following: + +```php +$paginator->setBeforeQueryCallback(function (Paginator $paginator, Pagination $pagination) { + +}); + +$paginator->setAfterQueryCallback(function (Paginator $paginator, Pagination $pagination) { + +}); +``` + +This is handy if you want to perform some function before and after each query is made. + Pagination Object -------------------------------------------------