CActiveDataProvider With Custom Query

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

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to freewebmentor[email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:

Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Article Tags: ,