CActiveDataProvider With Custom Query

By Prem Tiwari in Yii framework. Updated on


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

Sharing is caring!


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (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.

You might also like:

Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.