Skip to content

Commit

Permalink
Update PaginatorExtension.php (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarlovi committed Nov 28, 2023
1 parent 129e8bb commit 76734aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Bridge/Twig/Extension/PaginatorExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public function getFunctions(): array

return range(1, ceil($count / ($limit ?? $database->getPageLimit())));
}),
new TwigFunction('yassg_paginate', function (string $name, int $page, array $conditions = []) {
new TwigFunction('yassg_paginate', function (string $name, int|string $page, array $conditions = []) {
$page = (int) $page;
$database = $this->provider->getDatabase($name);

$conditions['limit'] ??= $database->getPageLimit();
Expand Down

0 comments on commit 76734aa

Please sign in to comment.