- Fixed a bug where a custom form context would never be applied
This commit is contained in:
1 parent
23e8eb71f6
commit
ff57fed699
6 files changed
+92
-6
No files matched your search
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace Picea\Ui\Method;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
class PaginationHandler {
|
||||
|
||||
protected ServerRequestInterface $request;
|
||||
|
||||
protected FormInterface $form;
|
||||
|
||||
public int $limit;
|
||||
|
||||
public int $offset;
|
||||
|
||||
public int $page = 1;
|
||||
|
||||
public int $count;
|
||||
|
||||
public string $url;
|
||||
|
||||
public array $params;
|
||||
|
||||
public function __construct(ServerRequestInterface $request, string $name, ? string $url, ? array $params)
|
||||
{
|
||||
$this->request = $request;
|
||||
|
||||
$query = $request->getQueryParams();
|
||||
|
||||
$this->page = $query['page'] ?? 1;
|
||||
$this->limit = 15;
|
||||
$this->offset = 1;
|
||||
$this->count = $this->page * $this->limit;
|
||||
|
||||
if ( $url ) {
|
||||
$this->url = $url;
|
||||
}
|
||||
|
||||
$this->params = $params ?? [];
|
||||
}
|
||||
|
||||
public function __toString() {
|
||||
return "hello world";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user