I'm trying to pass this model scope into my CListView
here is the scope in my Comment model
public function scopes()
{
return array(
'lastestComment'=>array(
'alias' => 't',
'select'=>array('t.*,t2.*'),
'join'=>'JOIN `comments_posts` AS t2',
'condition'=>'t.id=t2.commentId',
'order'=>'t.createDate ASC',
'limit'=>'5'
)
);
}
in my view i have this
$dataProvider=new CActiveDataProvider(Comment::model()->lastestComment());
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view', //view file location
));
in the view, then i call $data
i can only get values in the comments
model and not from the comments_post
table in my scope join. Any ideas?