Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
reiz committed Nov 15, 2013
1 parent 8d2f915 commit 4c89bb7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Expand Up @@ -122,7 +122,7 @@ It will produce something like this:


## Infinite Scroll
Strana comes with out of the box Infinite Scrolling, enable it with just one method.
Strana comes with out of the box Infinite Scrolling, enable it with just one method.

```PHP
$strana->infiniteScroll()->perPage(10)->make($records);
Expand Down Expand Up @@ -150,7 +150,7 @@ Strana uses the awesome [Infinite Ajax Scroll](https://github.com/webcreate/Infi
```PHP
$iasConfig = array(
'loaderDelay' => 600,
'loader' => '<img src="images/loader.gif"/>',
'loader' => '<img src="images/loader.gif"/>',
);

$strana->infiniteScroll($iasConfig)->perPage(10)->make($records);
Expand Down Expand Up @@ -223,7 +223,7 @@ class CustomAdapter implements CollectionAdapter{
$this->records = $records;
$this->configHelper = $configHelper;
}

/**
* This method should limit and offset your records and return.
*/
Expand All @@ -232,18 +232,18 @@ class CustomAdapter implements CollectionAdapter{
// Here you will get the database object passed to Strana.
// Clone it.
$records = clone($this->records);

// Get the limit number from Strana config
$limit = $this->configHelper->getLimit();

// Get the offset number from Strana config
$offset = $this->configHelper->getOffset();

// Limit your records
$records->limit($limit);
// Offset your records
$records->offset($offset);

// Return your sliced records
return $records->get();
}
Expand All @@ -256,7 +256,7 @@ class CustomAdapter implements CollectionAdapter{
// Here you will get the database object passed to Strana.
// Clone it.
$records = clone($this->records);

// Return your total records count, unsliced.
return $records->count();
}
Expand Down

0 comments on commit 4c89bb7

Please sign in to comment.