S
S
Sergey2015-05-13 14:02:55
MySQL
Sergey, 2015-05-13 14:02:55

Is it possible to make pagination in yii1 without using Criteria?

Is it possible to make pagination based on CDbCommand?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2015-05-13
@liff

Use setCurrentPage, setItemCount, setPageSize in CPagination to set it up.
How the CPagination data is obtained is not important.
Example:
$pageSize = 20;
$count = News::model()->count();
$pages = new CPagination($count);
$pages->setPageSize($pageSize);
$pages->params = array();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question