Skip to content

Commit c6e1071

Browse files
update
1 parent f9059ed commit c6e1071

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ was pretty tough. So i decided to create a much more easier way of communicating
7777
* [Pagination Showing](#pagination-showing)
7878
* [Pagination Showing Config](#pagination-showing-config)
7979
* [Pagination Foreach Numbers](#pagination-foreach-numbers)
80+
* [Pagination Ajax Loading](#pagination-ajax-loading)
8081
* [Get Pagination](#get-pagination)
8182
* [Clause](#clause)
8283
* [query](#query)
@@ -790,6 +791,38 @@ foreach($users as $user){
790791
}
791792
```
792793

794+
### Pagination Ajax Loading
795+
- When the view is either `loading|` \| `onloading`
796+
- This can automatically fetched data without page load
797+
- You need to give your DOM-element `data-pagination-content` and `data-pagination-append`
798+
799+
```php
800+
$users = DB::table('users')->paginate(20);
801+
```
802+
803+
```html
804+
<div data-pagination-content>
805+
<div class="wallet-container" data-pagination-append>
806+
<?php foreach($users as $user) {?>
807+
<!-- Content to be loaded structure -->
808+
<?php }?>
809+
</div>
810+
</div>
811+
812+
or
813+
814+
<div data-pagination-content data-pagination-append>
815+
<!-- Content to be loaded structure -->
816+
</div>
817+
818+
<!-- pagination links -->
819+
<div>
820+
<?= $users->links([
821+
'no_content' => 'All users have been loaded.'
822+
]); ?>
823+
</div>
824+
```
825+
793826
### Get Pagination
794827
- Returns pagination informations
795828

tests/testLoop.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
<!-- pagination links -->
125125
<div>
126126
<?= $wallets->links([
127-
'no_content' => 'All Wallets has been loaded.'
127+
'no_content' => 'All Wallets have been loaded.'
128128
]); ?>
129129
</div>
130130
</body>

0 commit comments

Comments
 (0)