I was struggling with one problem today, but managed to solve it by myself.
Now I have another problem. I’ve found that it is better to use CActiveDataProvider class for such situations. Here’s the code of my DataProvider:
$dataProvider=new CActiveDataProvider('Category', array(
'criteria'=>array(
'with'=>array('products'),
'condition'=>'t.id=1',
),
));
Then I’ve passed this data provider to a widget, but couldn’t access its values.
If someone can, please guide me through the process. Thanks.
Got it working with the help of Yii community (thank you :))
Here’s the code for controller: