I used this instruction to create a page breakdown http://rmcreative.ru/blog/post/postranichnaja-razbivka-v-yii
My code is:
// Постраничная выборка всех рекламных новостей $criteria=new CDbCriteria; $criteria->condition='is_reklama=:isRekl'; $criteria->params=array(':isRekl'=>1); $count=Article::model()->count($criteria); $pagination=new CPagination($count); $pagination->pageSize=3; $pagination->applyLimit($criteria); $articles = Article::model()->findAll($criteria); I have a request with the condition is_reklama=:isRekl . I need to add another condition to the sample. For this, I decided to replace the findAll() method with findAllByAttributes() . But I can’t understand how to findAllByAttributes() pass several query conditions using CDbCriteria ? If you do not use CDbCriteria , then everything is clear, just by the parameter I pass an array of keys and values. And for pagination, you need a query from CDbCriteria . Thank you in advance)