mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
fix gifts pagination (#984)
This commit is contained in:
parent
43de40a0dc
commit
cc5a56917b
2 changed files with 7 additions and 0 deletions
|
@ -42,4 +42,10 @@ class Gifts
|
||||||
foreach($cats as $cat)
|
foreach($cats as $cat)
|
||||||
yield new GiftCategory($cat);
|
yield new GiftCategory($cat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getCategoriesCount(): int
|
||||||
|
{
|
||||||
|
$cats = $this->cats->where("deleted", false);
|
||||||
|
return $cats->count();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ final class GiftsPresenter extends OpenVKPresenter
|
||||||
|
|
||||||
$this->template->user = $user;
|
$this->template->user = $user;
|
||||||
$this->template->iterator = $cats;
|
$this->template->iterator = $cats;
|
||||||
|
$this->template->count = $this->gifts->getCategoriesCount();
|
||||||
$this->template->_template = "Gifts/Menu.xml";
|
$this->template->_template = "Gifts/Menu.xml";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue