mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-20 00:20:44 +08:00
hide summary when empty.
This commit is contained in:
@@ -147,6 +147,9 @@ abstract class BaseListView extends Widget
|
|||||||
public function renderSummary()
|
public function renderSummary()
|
||||||
{
|
{
|
||||||
$count = $this->dataProvider->getCount();
|
$count = $this->dataProvider->getCount();
|
||||||
|
if ($count <= 0) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
if (($pagination = $this->dataProvider->getPagination()) !== false) {
|
if (($pagination = $this->dataProvider->getPagination()) !== false) {
|
||||||
$totalCount = $this->dataProvider->getTotalCount();
|
$totalCount = $this->dataProvider->getTotalCount();
|
||||||
$begin = $pagination->getPage() * $pagination->pageSize + 1;
|
$begin = $pagination->getPage() * $pagination->pageSize + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user