diff --git a/src/ListJsonTable.php b/src/ListJsonTable.php index 62b1d89..26c7742 100644 --- a/src/ListJsonTable.php +++ b/src/ListJsonTable.php @@ -276,10 +276,10 @@ class ListJsonTable extends JasonTable if ($this->pagination) { $options = [ 'countItem' => $this->data['meta']['total'], - 'perPage' => $this->data['meta']['perPage'], - 'currentPage' => $this->data['meta']['currentPage'], - 'baseUrl' => $this->baseUrl, - 'prefix' => $this->data['meta']['paginationPrefix'], + 'perPage' => $this->data['meta']['perPage'] ?? 10, + 'currentPage' => $this->data['meta']['currentPage'] ?? 1, + 'baseUrl' => $this->baseUrl ?? '', + 'prefix' => $this->data['meta']['paginationPrefix'] ?? '/page', ]; $pagination = new Pagination($options); $pagination->create(); diff --git a/src/ViewJsonTable.php b/src/ViewJsonTable.php index 96cd7b7..181d699 100644 --- a/src/ViewJsonTable.php +++ b/src/ViewJsonTable.php @@ -13,9 +13,14 @@ class ViewJsonTable extends JasonTable private array $dataJson; public function __construct($json) { + $this->beforePrintCell = false; $this->json = $json; $this->data = json_decode($this->json, true); $this->dataJson = $this->data['data']; + $this->beforePrintHook = function () { + }; + $this->afterPrintHook = function () { + }; } public function beginTable(): void