Tag Archives: Yii Pagination

Yii Pagination For CActiveDataProvider

This tutorial will helpful to understand about pagesize in cgridview or listview. Here i added the source code to show number of records per page. $criteria=new CDbCriteria; if($isdesired!=”){ $criteria->addCondition(“status=1”); $pagination=array(‘pageSize’=>8); $dataProvider=new CActiveDataProvider(‘Document’, array(‘criteria’=>$criteria,’pagination’=>$pagination )); $this->render(‘documentviewindex’, array(‘dataProvider’=>$dataProvider, )); }

Yii Framework 2 : Custom Pagination

When we are having more data and have to split it as many pages using pagination. By default, Yii2.0 is having that option for pagination. For the pagination, we have to send some information to page they are total item count, page size(number of records per page), current page etc. Simple Pagination CustomPagination Class Custom […]