Wiki

Articles tagged with "cactivedataprovider", sorted by commentsX
Displaying 1-5 of 5 result(s).

CGridView, CListView and CActiveDataProvider

Created 3 years ago by softarkTutorials22 comments – viewed 112,383 times – ( +46 ) – version 1.1
CGridView (or CListView) together with CActiveDataProvider is a very powerful combination of the built-in tools of Yii. But how do they work together to accomplish their fantastic functions? And what are you expected to do to use them and to customize their behaviors? This article explains the very basics of them.

An easy way to use escopes and CActiveDataProvider

Created 5 years ago by Rafael GarciaTips8 comments – viewed 27,470 times – ( +1 / -1 ) – version 1.1
Often used scopes to define criteria in our models. This is a very useful feature as it ensures that in any part of application applying the criteria defined by the scope when called it.

multiple CActiveDataProviders in one CGridView

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos7 comments – viewed 19,734 times – ( +8 / -1 ) – version 1.1
There is a few cases that you want more of one CActiveDataProvider displayed in one CGrideView How to do that?

Using cache in CActiveDataProvider

Created 4 years ago by StammTips7 comments – viewed 19,630 times – ( +21 ) – version 1.1
First param in CActiveDataProvider could be a string with model name or instance of class. So, you may use CActiveRecord::cache() for cache, but you need set third param to 2, because you should cache 2 queries: counting and get data.

1:n relations sometimes require CDbCriteria.together

Created 4 years ago by fsbTips5 comments – viewed 35,792 times – ( +16 ) – version 1.1
There are situations in which Active Record will generate nonsense queries from what a nieve Yii user might think is reasonable code. One such situation is a CActiveDataProvider using CDbCriteria to get data from parent and 1:n child table with a condition on the child table.