Skip to content

Commit 2fa9a14

Browse files
committed
Add note about setting up for usage, remove method specific loading example
1 parent efea59e commit 2fa9a14

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,12 @@ Plugin::load('BryanCrowe/ApiPagination');
2626

2727
## Usage
2828

29-
Load the component in a controller's `initialize()` method:
29+
Make sure your application has been set up to use data views, see http://book.cakephp.org/3.0/en/views/json-and-xml-views.html#enabling-data-views-in-your-application.
30+
31+
Then, load `ApiPaginationComponent`:
3032

3133
``` php
32-
public function initialize()
33-
{
34-
parent::initialize();
35-
$this->loadComponent('BryanCrowe/ApiPagination.ApiPagination');
36-
}
34+
$this->loadComponent('BryanCrowe/ApiPagination.ApiPagination');
3735
```
3836

3937
Your JsonView and XmlView responses will now contain the pagination information,

0 commit comments

Comments
 (0)