Compare commits
1 Commits
f2b50b4f60
...
v0.15.17
| Author | SHA1 | Date | |
|---|---|---|---|
| b17313c8fb |
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Twig\Components;
|
||||
|
||||
use App\Util\Paginator;
|
||||
use Doctrine\ORM\Query;
|
||||
use Symfony\UX\LiveComponent\Attribute\LiveAction;
|
||||
use Symfony\UX\LiveComponent\Attribute\LiveArg;
|
||||
use Symfony\UX\LiveComponent\Attribute\LiveProp;
|
||||
@@ -19,4 +21,10 @@ trait PaginateTrait
|
||||
{
|
||||
$this->pageNumber = $page;
|
||||
}
|
||||
|
||||
private function asPaginator(Query $query): Paginator
|
||||
{
|
||||
return (new Paginator())
|
||||
->paginate($query, $this->pageNumber, $this->perPage);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user