fix: monitors page & pagination

This commit is contained in:
2025-06-01 14:07:29 -05:00
parent b1ccf3bf00
commit 393e3ef41f
8 changed files with 90 additions and 10 deletions

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Twig\Components;
use Symfony\UX\LiveComponent\Attribute\LiveAction;
use Symfony\UX\LiveComponent\Attribute\LiveArg;
use Symfony\UX\LiveComponent\Attribute\LiveProp;
trait PaginateTrait
{
#[LiveProp(writable: true)]
public int $pageNumber = 1;
#[LiveProp(writable: true)]
public int $perPage = 5;
#[LiveAction]
public function paginate(#[LiveArg] int $page)
{
$this->pageNumber = $page;
}
}