You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
final class HomepagePresenter extends Nette\Application\UI\Presenter
{
#[Persistent]
public int $page=1;
#[Persistent]
public int $items=10;
#[Persistent]
public OrderBy $orderBy = OrderBy::ASC;
public function renderDefault() : void
{
$count = $this->brand->getCount();
$paginator = new Nette\Utils\Paginator;
$paginator->setItemCount($count);
$paginator->setItemsPerPage($this->items);
$paginator->setPage($this->page);
$brands = $this->brand->getPage($paginator->getOffset(), $paginator->getLength(),$this->orderBy);
$this->template->brands = $brands;
$this->template->paginator = $paginator;
}
}
<?php
namespace app\Model;
enum OrderBy: string
{
case DESC = 'DESC';
case ASC = 'ASC';
}
When clicking on this page(load same action in same presenter) got error Value passed to persistent parameter 'orderBy' in presenter Homepage must be [app\Model\OrderBy].
The text was updated successfully, but these errors were encountered:
Peesenter
Template
Enum:
When clicking on this page(load same action in same presenter) got error
Value passed to persistent parameter 'orderBy' in presenter Homepage must be [app\Model\OrderBy].
The text was updated successfully, but these errors were encountered: