Hello!
I want to load relational tables with CActiveDataProvider.
When I go to documentation of CActiveDataProvider, I see the following snippet of code:
$dataProvider=new CActiveDataProvider('Post', array(
'criteria'=>array(
'condition'=>'status=1',
'order'=>'create_time DESC',
'with'=>array('author'),
),
'pagination'=>array(
'pageSize'=>20,
),
));
// $dataProvider->getData() will return a list of Post objects
So ‘with’=>array(‘author’), is specified for criteria. When I try to do pretty much the same in my application, and then trying to read property of related table I get error at line <?=$item->source->name?>:
Can someone explain is it possible at all to use with() method in CActiveDataprovider and what am I doing wrong?