Hello,
I have a model Event:
...
/**
* @return array relational rules.
*/
public function relations() {
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'images' => array(self::MANY_MANY, 'Image', '{{event_image}}(event_id, image_id)'),
'user' => array(self::BELONGS_TO, 'User', 'user_id')
);
}
...
Then I create a widget:
...
public function run() {
$listNews = Event::model()->with('images')->findAll();
$this->render('listNews', array('listNews' => $listNews));
}
...
But the images array is always empty in my view… what the hell is going on?