pagination fix
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Itguild\Tables;
|
||||
|
||||
use Exception;
|
||||
use Itguild\Tables\ActionColumn\ActionColumn;
|
||||
use Itguild\Tables\ActionColumn\DeleteActionColumn;
|
||||
use Itguild\Tables\ActionColumn\EditActionColumn;
|
||||
@ -170,6 +171,9 @@ class ListJsonTable
|
||||
return $actions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create(): void
|
||||
{
|
||||
$this->setActions();
|
||||
@ -192,6 +196,9 @@ class ListJsonTable
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function endTable(): void
|
||||
{
|
||||
$this->html .= "</table>";
|
||||
@ -199,12 +206,14 @@ class ListJsonTable
|
||||
$this->html .= $hookAfter($this->data['meta']);
|
||||
|
||||
if ($this->pagination){
|
||||
$pagination = new Pagination(
|
||||
$this->data['meta']['total'],
|
||||
$this->data['meta']['perPage'],
|
||||
$this->data['meta']['currentPage'],
|
||||
$this->baseUrl
|
||||
);
|
||||
$options = [
|
||||
'countItem' => $this->data['meta']['total'],
|
||||
'perPage' => $this->data['meta']['perPage'],
|
||||
'currentPage' => $this->data['meta']['currentPage'],
|
||||
'baseUrl' => $this->baseUrl,
|
||||
'prefix' => $this->data['meta']['prefix'],
|
||||
];
|
||||
$pagination = new Pagination($options);
|
||||
$pagination->create();
|
||||
$this->html .= $pagination->fetch();
|
||||
}
|
||||
|
Reference in New Issue
Block a user