fix gifts pagination

This commit is contained in:
lalka2016 2023-09-18 17:47:19 +03:00
parent 43de40a0dc
commit 30727b801d
2 changed files with 7 additions and 0 deletions

View file

@ -42,4 +42,10 @@ class Gifts
foreach($cats as $cat)
yield new GiftCategory($cat);
}
function getCategoriesCount(): int
{
$cats = $this->cats->where("deleted", false);
return $cats->count();
}
}

View file

@ -41,6 +41,7 @@ final class GiftsPresenter extends OpenVKPresenter
$this->template->user = $user;
$this->template->iterator = $cats;
$this->template->count = $this->gifts->getCategoriesCount();
$this->template->_template = "Gifts/Menu.xml";
}