Hi good morning,
i have the next relation:
‘contratos’=>array(self::HAS_MANY,‘DuracionContratos’,‘trabajadores_id’),
In the gridView I show it this way:
array(
'name'=>'contrato',
'header'=>'Contrato/Prórroga',
'value'=>'Trabajadores::rawTest2($data->contratos)',
'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?