Wiki

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

CGridView, CListView and CActiveDataProvider

Created 2 years ago by softarkTutorials21 comments – viewed 83,491 times – ( +45 ) – 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 3 years ago by Rafael GarciaTips8 comments – viewed 22,010 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.

Using cache in CActiveDataProvider

Created 3 years ago by StammTips7 comments – viewed 15,246 times – ( +20 ) – 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.

multiple CActiveDataProviders in one CGridView

Created about a year ago by KonApazHow-tos6 comments – viewed 12,225 times – ( +7 / -1 ) – version 1.1
There is a few cases that you want more of one CActiveDataProvider displayed in one CGrideView How to do that?

1:n relations sometimes require CDbCriteria.together

Created 2 years ago by fsbTips5 comments – viewed 26,751 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.