Z
Z
ZaurK2016-10-28 11:59:34
Yii
ZaurK, 2016-10-28 11:59:34

How to display records from the database using ListView without displaying the line "Records 1-6 of 6 are shown"?

Hello! I display records from the database in a loop using the ListView widget, but the output of the line "Showing records 1-6 of 6" confuses me. How to remove this entry? Or is it better to output via foreach without using the ListView widget?
Here is my code:
index.php:

<?php
use yii\widgets\ListView;
use yii\data\ActiveDataProvider;
use common\models\Good;

/* @var $this yii\web\View */

$this->title = 'My Yii Application';
?>

<?php

$dataProvider = new ActiveDataProvider([
    'query' => Good::find()->orderBy('id DESC'),
    
]);


echo ListView::widget([
    'dataProvider' => $dataProvider,
    'itemView' => '_workitem',
]);

_workitem.php:
<?php
use yii\helpers\Html;

?>
 

<div class="col-sm-6 col-md-3 isotope-item <?= Html::encode($model->catalog_id) ?>">
                <div class="image-box">
                  <div class="overlay-container">
                    <?= Html::encode($model->image) ?>
                    <a class="overlay" data-toggle="modal" data-target="#project-<?= Html::encode($model->id) ?>">
                      <i class="fa fa-search-plus"></i>
                    </a>
                  </div>
                  
                </div>
                
              </div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2016-10-28
@ZaurK

listView has a default layout parameter
, it is equal to "{summary}\n{items}\n{pager}"
Remove {summary} and that's it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question