So, I am looking for a possibility to add a HAS_MANY relationship to a cgridview. I know there are several distinct possibilities, but none of them perfectly suit my need.

I will now list some solution that I do NOT need.

The first possibility is the nameless function in the value field, or an advanced implode.

The second possibility is starting from the many object and using the BELONGS_TO relationship (in the case of a MANY_MANY, you can start with making an object of the relationship table and use the two corresponding BELONGS_TO relationships)

However, these do not work as well as I would like. First of all, I want each combination to be on a separate line. And secondly, I want to start with the HAS_MANY object in my activeDataProvider. The example for this use-case is a training with attendees.

A training has a title, a description, a trainer and many attendees.

I have been looking into the fact that a relationship with a HAS_MANY can be represented by an array. Example:

$data->attendees[0]. This is a useful fact for the nameless function, wherein you could use a foreach. However, I would need a way to force the cgridview to iterate over the relationship using multiple lines.

My question to the community is it possible to display an HAS_MANY relationship on multiple lines, given the previously explained situation.

Maybe this article provides some help/ideas.