A
A
arab7892015-04-29 12:43:45
Yii
arab789, 2015-04-29 12:43:45

Yii. CActiveDataProvider. How to remove the display of the number of elements?

I am commenting on page 3:

public static function page_review($page_id) {
            
            $criteria=new CDbCriteria;

            $criteria->compare('page_id',$page_id);
            $criteria->compare('status', 1);
            
            $criteria->order = 'created DESC';
            $criteria->limit = 3;
            
            return new CActiveDataProvider('Review', array(
      'criteria'=>$criteria,
                        'pagination'=>false,
    ));
        }

When viewing, the number of received elements from the database is displayed (ie 3). How to get rid of this entry?
'totalItemCount'=>false
does not help, but when:
'itemCount'=>false
does not plow at all.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vyachin, 2015-05-08
@arab789

It is not the CActiveDataProvider that is responsible for displaying the number of elements, but the CListView or CGridView widget. You can disable it through this property https://github.com/yiisoft/yii/blob/master/framewo... by removing {summary}. CGridView has the same property

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question