CActiveDataProvider With Custom Query

Prem Tiwari - - 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


Prem Tiwari

Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer and a blogger by hobby.

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.