CActiveDataProvider and parameterised named scopes

I have a parameterised named scope which I use to provide searching on a datamodel e.g.

$data = MyModel:model()->searchFor($q)->findAll(..);

Is there a way to specify parameterised named scopes when using a CActiveDataProvider?



Maybe, this is what you’re looking for?

Thanks Nagash

This extension seems to support normal scopes but not parameterised scopes.


I know this is a couple of years past when you asked the question, but for people looking at this thread in the future, check out this thread:

I ended up figuring it out. Yii 1.1.7 allows you to call a scoping function with parameters. Quite cool.

Here is an example of using a parameterized named scope in both the find() functions and in dataprovider generation:

Parameterized named scope