CActiveDataProvider is a wrapper for CActiveRecord with advanced sorting , pagination and filtering capabilities. Typically, CActiveDataProvider used in conjunction with zii widgets, such as CListView or CGridView , which use their sorting and search capabilities. Therefore, if you want to display data in terms of a list or table using (optional) sorting / filtering / pagination - the most convenient way to do this in Yii is to use the described zii widgets or their extensions.
If you just need to extract the data and use it in some other way, but without the smart rendering mechanisms provided by CListView or CGridView , use CActiveRecord because it does nothing but select the data.
link
source share