Skip to content

Commit

Permalink
Added before and after query callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
AshleyDawson committed Jan 25, 2018
1 parent b3907dd commit ca3bf92
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<a name="pagination-object"></a>Pagination Object
-------------------------------------------------

Expand Down

0 comments on commit ca3bf92

Please sign in to comment.