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?

Thanks

amc

Maybe, this is what you’re looking for?

http://www.yiiframework.com/extension/active-data-provider-with-scopes/

Thanks Nagash

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

amc

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: http://www.yiiframework.com/forum/index.php/topic/23358-parameterized-vs-named-scopes-question-using-yii-118/

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