Displaying Has_Many In Gridview

Hi good morning,

i have the next relation:


In the gridView I show it this way:





		'type' => 'raw',


public static function rawTest2($plans) {

    $tmp = '<div class="raw2">';

    foreach ($plans as $plan) {

        $tmp = $tmp.$plan->contrato.'<br/>';


    $tmp = $tmp.'</div>';

    return $tmp;


the show is:

I can put the contratos 1,2,3 in different records?

Hi jairo1986,

Why don’t you create a gridview with Contrato as the main model?

I have it made, as you say, but I need to do a count for every record in the field numContrato.

I see.

I think you could implement a method in Contrado to count the number of the records that share the same Trabajadores.