Skip to content

ManyMany / protected / views / song / grid.php #1

@yjeroen

Description

@yjeroen

This part of your code is the question, right?

if ($this->action->id === 'reviews') {

// This is the bit that doesn't work.
// To produce a table of song reviews... How??
$columns[] = array(
    'name' => 'song.reviews.review',
    'filter' => CHtml::activeTextField($song, 'review'),
);
$song->criteria->group = 'reviews.song_id';
$song->criteria->with = array('song', 'song.reviews', 'genre');
$song->criteria->together = true;

}

I assume by grouping it to song_id, only one row is returned by the database per song. So you see only one review per song. Correct?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions