CActiveDataProvider With Custom Query

| Last Updated: | In: Yii framework


In This post i will explain the CActiveDataProvider With Custom Query. CActiveDataProvider everytime to retrieve the data for CGridView. But one of my project needed custom query in criteria and have to show the result in CGridView. Below is the source code for you that is enable the custom query in the model.

Component MyActiveDataProvider

Add this class inside “protected/components”.

Custom Query In Model

CGridview List Of Group Search


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.


You may also like:


,