开发者

How to get n records from a Yii data provider?

I have a model which has the following relationship declared:

'messages' => array(self::HAS_MANY, 'WallMessages', 'liga_id',
                'condition'=>'specific_post.parent_message_id IS NULL', 
                'order'=>'specific_post.date DESC', 
                'alias'=>'specific_post'),

Im trying to use this collection within a CListView with a custom pagination. However, if for example my pa开发者_运维知识库ges are of size 5, i need to get from elements 5 through 10 to populate the view.. How can i get n elements from a defined relationship?


you can use model's serach() or custom CDbCriteria yourself. CDbCriteria

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜